|
@ -929,7 +929,7 @@ Agent.prototype.addRequest = function(req, host, port) { |
|
|
}; |
|
|
}; |
|
|
Agent.prototype.createSocket = function(name, host, port) { |
|
|
Agent.prototype.createSocket = function(name, host, port) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
var s = self.createConnection(port, host); |
|
|
var s = self.createConnection(port, host, self.options); |
|
|
if (!self.sockets[name]) { |
|
|
if (!self.sockets[name]) { |
|
|
self.sockets[name] = []; |
|
|
self.sockets[name] = []; |
|
|
} |
|
|
} |
|
@ -1027,7 +1027,11 @@ function ClientRequest(options, cb) { |
|
|
if (self.socketPath) { |
|
|
if (self.socketPath) { |
|
|
self._last = true; |
|
|
self._last = true; |
|
|
self.shouldKeepAlive = false; |
|
|
self.shouldKeepAlive = false; |
|
|
|
|
|
if (options.createConnection) { |
|
|
|
|
|
self.onSocket(options.createConnection(self.socketPath)); |
|
|
|
|
|
} else { |
|
|
self.onSocket(net.createConnection(self.socketPath)); |
|
|
self.onSocket(net.createConnection(self.socketPath)); |
|
|
|
|
|
} |
|
|
} else if (self.agent) { |
|
|
} else if (self.agent) { |
|
|
// If there is an agent we should default to Connection:keep-alive.
|
|
|
// If there is an agent we should default to Connection:keep-alive.
|
|
|
self._last = false; |
|
|
self._last = false; |
|
@ -1037,8 +1041,12 @@ function ClientRequest(options, cb) { |
|
|
// No agent, default to Connection:close.
|
|
|
// No agent, default to Connection:close.
|
|
|
self._last = true; |
|
|
self._last = true; |
|
|
self.shouldKeepAlive = false; |
|
|
self.shouldKeepAlive = false; |
|
|
|
|
|
if (options.createConnection) { |
|
|
|
|
|
self.onSocket(options.createConnection(options.port, options.host, options)); |
|
|
|
|
|
} else { |
|
|
self.onSocket(net.createConnection(options.port, options.host)); |
|
|
self.onSocket(net.createConnection(options.port, options.host)); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
self._deferToConnect(null, null, function () { |
|
|
self._deferToConnect(null, null, function () { |
|
|
self._flush(); |
|
|
self._flush(); |
|
|