From e01811e7f4894d7f0f7f4bd8492cccec6f6b4038 Mon Sep 17 00:00:00 2001 From: Sebastian Philipp Date: Wed, 22 Jul 2015 12:52:31 +0200 Subject: [PATCH] src: fixed compile error C2143 for vs2012 PR-URL: https://github.com/joyent/http-parser/pull/261 Reviewed-By: Fedor Indutny --- http_parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http_parser.c b/http_parser.c index 2f3a66b..99f5a23 100644 --- a/http_parser.c +++ b/http_parser.c @@ -1841,11 +1841,12 @@ reexecute: case s_headers_done: { + int hasBody; STRICT_CHECK(ch != LF); parser->nread = 0; - int hasBody = parser->flags & F_CHUNKED || + hasBody = parser->flags & F_CHUNKED || (parser->content_length > 0 && parser->content_length != ULLONG_MAX); if (parser->upgrade && (parser->method == HTTP_CONNECT || (parser->flags & F_SKIPBODY) || !hasBody)) {