http: reset headers_nread_ on llhttp parser reuse

PR-URL: https://github.com/nodejs-private/node-private/pull/149
Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Rod Vagg 2018-11-27 11:04:09 +11:00
parent af8d9e3972
commit 7bfcfc2ffe

View File

@ -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 */