From 59a37f6600c3c4ce926d3a27c66958ce379070f5 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 20 Aug 2009 13:32:25 +0200 Subject: [PATCH] Inline http_parser_should_keep_alive(). --- http_parser.h | 11 ++++++++++- http_parser.rl | 14 -------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/http_parser.h b/http_parser.h index ead1e5e..7d46cdf 100644 --- a/http_parser.h +++ b/http_parser.h @@ -145,7 +145,16 @@ size_t http_parser_execute (http_parser *parser, const char *data, size_t len); int http_parser_has_error (http_parser *parser); -int http_parser_should_keep_alive (http_parser *parser); +static inline int +http_parser_should_keep_alive (http_parser *parser) +{ + if (parser->keep_alive == -1) { + if (parser->version_major == 1) return (parser->version_minor != 0); + return 0; + } + return parser->keep_alive; +} + #ifdef __cplusplus } diff --git a/http_parser.rl b/http_parser.rl index 7368dea..8cc6118 100644 --- a/http_parser.rl +++ b/http_parser.rl @@ -488,17 +488,3 @@ http_parser_has_error (http_parser *parser) if (parser->error) return 1; return parser->cs == http_parser_error; } - -int -http_parser_should_keep_alive (http_parser *parser) -{ - if (parser->keep_alive == -1) - if (parser->version_major == 1) - return (parser->version_minor != 0); - else if (parser->version_major == 0) - return 0; - else - return 1; - else - return parser->keep_alive; -}