Skip to content

Commit

Permalink
http: remove duplicate parser unset
Browse files Browse the repository at this point in the history
freeParser already unsets parser property of socket if socket is passed
in specifically. There's no need to do this twice.

PR-URL: #20126
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
apapirovski authored and jasnell committed Apr 23, 2018
1 parent cda94b2 commit 49275c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions lib/_http_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ function freeParser(parser, req, socket) {
if (parser._consumed)
parser.unconsume();
parser._consumed = false;
if (parser.socket)
parser.socket.parser = null;
parser.socket = null;
parser.incoming = null;
parser.outgoing = null;
Expand Down
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
socket.removeListener('error', socketOnError);
unconsume(parser, socket);
parser.finish();
freeParser(parser, req, null);
freeParser(parser, req, socket);
parser = null;

var eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade';
Expand Down

0 comments on commit 49275c4

Please sign in to comment.