http: remove reference to onParserExecute
Parsers hold a reference to the socket associated with the request through onParserExecute. This must be removed when the parser is freed so that the socket can be garbage collected when destroyed. Regression introduced in commit 59b91f1 ("http_parser: consume StreamBase instance"). PR-URL: https://github.com/nodejs/node/pull/4773 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
This commit is contained in:
parent
d26b014391
commit
5f6dfab832
@ -20,6 +20,7 @@ const kOnHeaders = HTTPParser.kOnHeaders | 0;
|
||||
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
|
||||
const kOnBody = HTTPParser.kOnBody | 0;
|
||||
const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0;
|
||||
const kOnExecute = HTTPParser.kOnExecute | 0;
|
||||
|
||||
// Only called in the slow case where slow means
|
||||
// that the request headers were either fragmented
|
||||
@ -169,6 +170,7 @@ var parsers = new FreeList('parsers', 1000, function() {
|
||||
parser[kOnHeadersComplete] = parserOnHeadersComplete;
|
||||
parser[kOnBody] = parserOnBody;
|
||||
parser[kOnMessageComplete] = parserOnMessageComplete;
|
||||
parser[kOnExecute] = null;
|
||||
|
||||
return parser;
|
||||
});
|
||||
@ -194,6 +196,7 @@ function freeParser(parser, req, socket) {
|
||||
parser.socket = null;
|
||||
parser.incoming = null;
|
||||
parser.outgoing = null;
|
||||
parser[kOnExecute] = null;
|
||||
if (parsers.free(parser) === false)
|
||||
parser.close();
|
||||
parser = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user