File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -959,10 +959,10 @@ function connectionListener(socket) {
959959exports . _connectionListener = connectionListener ;
960960
961961
962-
963- function Agent ( host , port ) {
964- this . host = host ;
965- this . port = port ;
962+ function Agent ( options ) {
963+ this . options = options ;
964+ this . host = options . host ;
965+ this . port = options . port ;
966966
967967 this . queue = [ ] ;
968968 this . sockets = [ ] ;
@@ -1228,7 +1228,7 @@ function getAgent(host, port) {
12281228 var agent = agents [ id ] ;
12291229
12301230 if ( ! agent ) {
1231- agent = agents [ id ] = new Agent ( host , port ) ;
1231+ agent = agents [ id ] = new Agent ( { host : host , port : port } ) ;
12321232 }
12331233
12341234 return agent ;
@@ -1248,7 +1248,7 @@ exports.request = function(options, cb) {
12481248 if ( options . agent === undefined ) {
12491249 options . agent = getAgent ( options . host , options . port ) ;
12501250 } else if ( options . agent === false ) {
1251- options . agent = new Agent ( options . host , options . port ) ;
1251+ options . agent = new Agent ( options ) ;
12521252 }
12531253 return exports . _requestFromAgent ( options , cb ) ;
12541254} ;
Original file line number Diff line number Diff line change @@ -26,9 +26,7 @@ exports.createServer = function(opts, requestListener) {
2626var agents = { } ;
2727
2828function Agent ( options ) {
29- http . Agent . call ( this , options . host , options . port ) ;
30-
31- this . options = options ;
29+ http . Agent . call ( this , options ) ;
3230}
3331inherits ( Agent , http . Agent ) ;
3432
You can’t perform that action at this time.
0 commit comments