summaryrefslogtreecommitdiff
path: root/vendor/http_parser/http_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/http_parser/http_parser.c')
-rw-r--r--vendor/http_parser/http_parser.c11
1 files changed, 7 insertions, 4 deletions
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;
}