Skip to content

Commit

Permalink
http,tls: name anonymous callbacks
Browse files Browse the repository at this point in the history
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: #21412
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Refs: #8913
  • Loading branch information
mlrv authored and targos committed Aug 6, 2018
1 parent d66e52f commit 1ca46ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/_http_outgoing.js
Expand Up @@ -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 {
Expand All @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/_tls_common.js
Expand Up @@ -240,7 +240,7 @@ exports.translatePeerCertificate = function translatePeerCertificate(c) {
c.infoAccess = Object.create(null);

// XXX: More key validation?
info.replace(/([^\n:]*):([^\n]*)(?:\n|$)/g, function(all, key, val) {
info.replace(/([^\n:]*):([^\n]*)(?:\n|$)/g, (all, key, val) => {
if (key in c.infoAccess)
c.infoAccess[key].push(val);
else
Expand Down

0 comments on commit 1ca46ab

Please sign in to comment.