Skip to content

Commit

Permalink
http: add note about timer unref
Browse files Browse the repository at this point in the history
PR-URL: #34143
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
ronag authored and addaleax committed Sep 22, 2020
1 parent 4ae34e8 commit 4e07faa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ function socketOnData(server, socket, parser, state, d) {
}

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

0 comments on commit 4e07faa

Please sign in to comment.