Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
http: clean up HttpParser correctly
remove reference to kOnMessageBegin from HttpParser to avoid leaking Server instances in FreeList
  • Loading branch information
sokra committed Jul 8, 2021
commit 7ad57879b279f18ce7e4d020fa0855a884d89c8d
2 changes: 2 additions & 0 deletions lib/_http_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ let debug = require('internal/util/debuglog').debuglog('http', (fn) => {

const kIncomingMessage = Symbol('IncomingMessage');
const kRequestTimeout = Symbol('RequestTimeout');
const kOnMessageBegin = HTTPParser.kOnMessageBegin | 0;
const kOnHeaders = HTTPParser.kOnHeaders | 0;
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
const kOnBody = HTTPParser.kOnBody | 0;
Expand Down Expand Up @@ -239,6 +240,7 @@ function cleanParser(parser) {
parser.incoming = null;
parser.outgoing = null;
parser.maxHeaderPairs = MAX_HEADER_PAIRS;
parser[kOnMessageBegin] = null;
Comment thread
ronag marked this conversation as resolved.
parser[kOnExecute] = null;
parser[kOnTimeout] = null;
parser._consumed = false;
Expand Down