Skip to content

Commit 49275c4

Browse files
apapirovskijasnell
authored andcommitted
http: remove duplicate parser unset
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>
1 parent cda94b2 commit 49275c4

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/_http_common.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ function freeParser(parser, req, socket) {
191191
if (parser._consumed)
192192
parser.unconsume();
193193
parser._consumed = false;
194-
if (parser.socket)
195-
parser.socket.parser = null;
196194
parser.socket = null;
197195
parser.incoming = null;
198196
parser.outgoing = null;

lib/_http_server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
522522
socket.removeListener('error', socketOnError);
523523
unconsume(parser, socket);
524524
parser.finish();
525-
freeParser(parser, req, null);
525+
freeParser(parser, req, socket);
526526
parser = null;
527527

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

0 commit comments

Comments
 (0)