Inline http_parser_should_keep_alive().

event_stream
Ryan 15 years ago
parent e244dbf797
commit 59a37f6600

@ -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_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 #ifdef __cplusplus
} }

@ -488,17 +488,3 @@ http_parser_has_error (http_parser *parser)
if (parser->error) return 1; if (parser->error) return 1;
return parser->cs == http_parser_error; 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;
}

Loading…
Cancel
Save