Skip to content

Commit

Permalink
http: remove redundant call to socket.setTimeout()
Browse files Browse the repository at this point in the history
`Socket.prototype.setTimeout()` clears the previous timer before setting
a new one.

Refs: #25748 (comment)

PR-URL: #25928
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
lpinca authored and addaleax committed Feb 6, 2019
1 parent 00d49ad commit cc5de5a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,6 @@ function resOnFinish(req, res, socket, state, server) {
}
} else if (state.outgoing.length === 0) {
if (server.keepAliveTimeout && typeof socket.setTimeout === 'function') {
socket.setTimeout(0);
socket.setTimeout(server.keepAliveTimeout);
state.keepAliveTimeoutSet = true;
}
Expand Down

0 comments on commit cc5de5a

Please sign in to comment.