We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a331a00 commit bcdf7e9Copy full SHA for bcdf7e9
lib/_http_agent.js
@@ -125,8 +125,8 @@ function Agent(options) {
125
return;
126
}
127
128
- let freeSockets = this.freeSockets[name];
129
- const freeLen = freeSockets ? freeSockets.length : 0;
+ const freeSockets = this.freeSockets[name] || [];
+ const freeLen = freeSockets.length;
130
let count = freeLen;
131
if (this.sockets[name])
132
count += this.sockets[name].length;
@@ -138,7 +138,6 @@ function Agent(options) {
138
139
140
141
- freeSockets = freeSockets || [];
142
this.freeSockets[name] = freeSockets;
143
socket[async_id_symbol] = -1;
144
socket._httpMessage = null;
0 commit comments