Skip to content

Commit

Permalink
http: reset headers_nread_ on llhttp parser reuse
Browse files Browse the repository at this point in the history
PR-URL: nodejs-private/node-private#149
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
rvagg committed Nov 27, 2018
1 parent 04e0620 commit 4ecbd3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4ecbd3b

Please sign in to comment.