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 <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: https://github.com/nodejs/node/issues/8913
This commit is contained in:
Родитель
d66e52fb8e
Коммит
1ca46ab6f4
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче