X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=vendor%2Fhttp_parser%2Fhttp_parser.c;h=95ff42f783d900d17fba6689ad0aa8ba8a55c231;hb=55a0a6ab66739fae65d123fadff1a31d96999c16;hp=0f76b6aca80e9ed9cd5337e1e6140ef1fd79f48d;hpb=5ea4b66f68ea776402d510ed7f7f2e0d61e12673;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/vendor/http_parser/http_parser.c b/vendor/http_parser/http_parser.c index 0f76b6aca..95ff42f78 100644 --- a/vendor/http_parser/http_parser.c +++ b/vendor/http_parser/http_parser.c @@ -731,6 +731,7 @@ reexecute: if (ch == CR || ch == LF) break; parser->flags = 0; + parser->extra_flags = 0; parser->content_length = ULLONG_MAX; if (ch == 'H') { @@ -768,6 +769,7 @@ reexecute: if (ch == CR || ch == LF) break; parser->flags = 0; + parser->extra_flags = 0; parser->content_length = ULLONG_MAX; if (ch == 'H') { @@ -925,6 +927,7 @@ reexecute: if (ch == CR || ch == LF) break; parser->flags = 0; + parser->extra_flags = 0; parser->content_length = ULLONG_MAX; if (UNLIKELY(!IS_ALPHA(ch))) { @@ -1338,7 +1341,7 @@ reexecute: parser->header_state = h_general; } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) { parser->header_state = h_transfer_encoding; - parser->flags |= F_TRANSFER_ENCODING; + parser->extra_flags |= F_TRANSFER_ENCODING >> 8; } break; @@ -1800,7 +1803,7 @@ reexecute: /* Cannot us transfer-encoding and a content-length header together per the HTTP specification. (RFC 7230 Section 3.3.3) */ - if ((parser->flags & F_TRANSFER_ENCODING) && + if ((parser->extra_flags & (F_TRANSFER_ENCODING >> 8)) && (parser->flags & F_CONTENTLENGTH)) { /* Allow it for lenient parsing as long as `Transfer-Encoding` is * not `chunked` @@ -1886,7 +1889,7 @@ reexecute: /* chunked encoding - ignore Content-Length header, * prepare for a chunk */ UPDATE_STATE(s_chunk_size_start); - } else if (parser->flags & F_TRANSFER_ENCODING) { + } else if (parser->extra_flags & (F_TRANSFER_ENCODING >> 8)) { if (parser->type == HTTP_REQUEST && !lenient) { /* RFC 7230 3.3.3 */ @@ -2162,7 +2165,7 @@ http_message_needs_eof (const http_parser *parser) } /* RFC 7230 3.3.3, see `s_headers_almost_done` */ - if ((parser->flags & F_TRANSFER_ENCODING) && + if ((parser->extra_flags & (F_TRANSFER_ENCODING >> 8)) && (parser->flags & F_CHUNKED) == 0) { return 1; }