Skip to content

Commit eb5b0d3

Browse files
committed
change self to agent
1 parent f774e72 commit eb5b0d3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/_http_agent.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,10 @@ Agent.prototype.createSocket = function createSocket(req, options, cb) {
212212
};
213213

214214
function installListeners(agent, s, options) {
215-
var self = agent;
216215

217216
function onFree() {
218217
debug('CLIENT socket onFree');
219-
self.emit('free', s, options);
218+
agent.emit('free', s, options);
220219
}
221220
s.on('free', onFree);
222221

@@ -225,7 +224,7 @@ function installListeners(agent, s, options) {
225224
// This is the only place where sockets get removed from the Agent.
226225
// If you want to remove a socket from the pool, just close it.
227226
// All socket errors end in a close event anyway.
228-
self.removeSocket(s, options);
227+
agent.removeSocket(s, options);
229228
}
230229
s.on('close', onClose);
231230

@@ -234,7 +233,7 @@ function installListeners(agent, s, options) {
234233
// (defined by WebSockets) where we need to remove a socket from the
235234
// pool because it'll be locked up indefinitely
236235
debug('CLIENT socket onRemove');
237-
self.removeSocket(s, options);
236+
agent.removeSocket(s, options);
238237
s.removeListener('close', onClose);
239238
s.removeListener('free', onFree);
240239
s.removeListener('agentRemove', onRemove);

0 commit comments

Comments
 (0)