From d7496bff9339408ffc969975d23024453907e21a Mon Sep 17 00:00:00 2001 From: Marco Levrero Date: Tue, 19 Jun 2018 22:03:33 +0100 Subject: http,tls: name anonymous callbacks This commit is to help in the effort to name all anonymous functions to help when heap debugging. Specifically, this commit fixes some anonymous functions used as listeners in the lib/ folder. PR-URL: https://github.com/nodejs/node/pull/21412 Reviewed-By: Weijia Wang Reviewed-By: Trivikram Kamat Reviewed-By: Benjamin Gruenbaum Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Anatoli Papirovski Reviewed-By: Jon Moss Refs: https://github.com/nodejs/node/issues/8913 --- lib/_http_outgoing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/_http_outgoing.js') diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 9139350486..d150a9d93c 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -183,7 +183,7 @@ OutgoingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { } if (!this.socket) { - this.once('socket', function(socket) { + this.once('socket', function socketSetTimeoutOnConnect(socket) { socket.setTimeout(msecs); }); } else { @@ -200,7 +200,7 @@ OutgoingMessage.prototype.destroy = function destroy(error) { if (this.socket) { this.socket.destroy(error); } else { - this.once('socket', function(socket) { + this.once('socket', function socketDestroyOnConnect(socket) { socket.destroy(error); }); } -- cgit v1.2.3