diff options
author | John Leidegren <john@leidegren.se> | 2020-05-01 08:14:25 +0200 |
---|---|---|
committer | Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> | 2020-05-05 16:14:46 +0200 |
commit | 26f150022f9b4d4709c1d4ad450c6f9e9fce8d0e (patch) | |
tree | 9acd4648992aec0a6dbf9311745f20cfba057f36 /lib | |
parent | c17dcb32533aa007dfbf507d22c28ef3c7c11c29 (diff) | |
download | node-new-26f150022f9b4d4709c1d4ad450c6f9e9fce8d0e.tar.gz |
http: fixes memory retention issue with FreeList and HTTPParser
Fixes: https://github.com/nodejs/node/issues/29394
Refs: https://github.com/nodejs/node/pull/33167#issuecomment-622102450
PR-URL: https://github.com/nodejs/node/pull/33190
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_http_common.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/_http_common.js b/lib/_http_common.js index eec965d7fc..2c836221f7 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -161,12 +161,10 @@ const parsers = new FreeList('parsers', 1000, function parsersCb() { cleanParser(parser); - parser.onIncoming = null; parser[kOnHeaders] = parserOnHeaders; parser[kOnHeadersComplete] = parserOnHeadersComplete; parser[kOnBody] = parserOnBody; parser[kOnMessageComplete] = parserOnMessageComplete; - parser[kOnTimeout] = null; return parser; }); @@ -232,7 +230,9 @@ function cleanParser(parser) { parser.outgoing = null; parser.maxHeaderPairs = MAX_HEADER_PAIRS; parser[kOnExecute] = null; + parser[kOnTimeout] = null; parser._consumed = false; + parser.onIncoming = null; } function prepareError(err, parser, rawPacket) { |