From cc5de5a5cc08551c54a2c1c40c05aa934d2156eb Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 4 Feb 2019 18:34:46 +0100 Subject: [PATCH] http: remove redundant call to socket.setTimeout() `Socket.prototype.setTimeout()` clears the previous timer before setting a new one. Refs: https://github.com/nodejs/node/pull/25748#discussion_r253393234 PR-URL: https://github.com/nodejs/node/pull/25928 Reviewed-By: Anna Henningsen Reviewed-By: Anatoli Papirovski Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/_http_server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/_http_server.js b/lib/_http_server.js index 5a714da6b6c428..f87c316345ab7f 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -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; }