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 <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
lpinca authored and addaleax committed Feb 6, 2019
1 parent 52d4b7a commit b7fb49e
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 @@ -589,7 +589,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 b7fb49e

Please sign in to comment.