Skip to content
Closed
Changes from 1 commit
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
Next Next commit
http: reset parser.incoming when server response is finished
This resolves a memory leak for keep-alive connections with a naïve
approach.

Fixes: #9668
  • Loading branch information
addaleax committed Jul 11, 2019
commit 609e2c2e87d1d8e5bd3dda69913f22117a5650d1
1 change: 1 addition & 0 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ function resOnFinish(req, res, socket, state, server) {
assert(state.incoming.length === 0 || state.incoming[0] === req);

state.incoming.shift();
if (socket.parser) socket.parser.incoming = null;
Comment thread
addaleax marked this conversation as resolved.

// If the user never called req.read(), and didn't pipe() or
// .resume() or .on('data'), then we call req._dump() so that the
Expand Down