From 7bfcfc2ffe4940898cf7b70890a55eb91cbdd112 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Tue, 27 Nov 2018 11:04:09 +1100 Subject: [PATCH] http: reset headers_nread_ on llhttp parser reuse PR-URL: https://github.com/nodejs-private/node-private/pull/149 Reviewed-By: Fedor Indutny --- src/node_http_parser.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index e24f378e3f2..18ac6599d80 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -784,6 +784,7 @@ class Parser : public AsyncWrap, public StreamListener { void Init(parser_type_t type) { #ifdef NODE_EXPERIMENTAL_HTTP llhttp_init(&parser_, type, &settings); + header_nread_ = 0; #else /* !NODE_EXPERIMENTAL_HTTP */ http_parser_init(&parser_, type); #endif /* NODE_EXPERIMENTAL_HTTP */