From b7fb49e70a3d7670884aeb22d56c9fe3584fda1c 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 799a1c55932b8b..f680d06bc10bc5 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -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; }