Skip to content

Commit 4e07faa

Browse files
ronagaddaleax
authored andcommitted
http: add note about timer unref
PR-URL: #34143 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 4ae34e8 commit 4e07faa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/_http_server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ function socketOnData(server, socket, parser, state, d) {
566566
}
567567

568568
function onParserExecute(server, socket, parser, state, ret) {
569+
// When underlying `net.Socket` instance is consumed - no
570+
// `data` events are emitted, and thus `socket.setTimeout` fires the
571+
// callback even if the data is constantly flowing into the socket.
572+
// See, https://github.com/nodejs/node/commit/ec2822adaad76b126b5cccdeaa1addf2376c9aa6
569573
socket._unrefTimer();
570574
debug('SERVER socketOnParserExecute %d', ret);
571575
onParserExecuteCommon(server, socket, parser, state, ret, undefined);

0 commit comments

Comments
 (0)