This repository was archived by the owner on Apr 22, 2023. It is now read-only.
File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -959,10 +959,10 @@ function connectionListener(socket) {
959
959
exports . _connectionListener = connectionListener ;
960
960
961
961
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 ;
966
966
967
967
this . queue = [ ] ;
968
968
this . sockets = [ ] ;
@@ -1228,7 +1228,7 @@ function getAgent(host, port) {
1228
1228
var agent = agents [ id ] ;
1229
1229
1230
1230
if ( ! agent ) {
1231
- agent = agents [ id ] = new Agent ( host , port ) ;
1231
+ agent = agents [ id ] = new Agent ( { host : host , port : port } ) ;
1232
1232
}
1233
1233
1234
1234
return agent ;
@@ -1248,7 +1248,7 @@ exports.request = function(options, cb) {
1248
1248
if ( options . agent === undefined ) {
1249
1249
options . agent = getAgent ( options . host , options . port ) ;
1250
1250
} else if ( options . agent === false ) {
1251
- options . agent = new Agent ( options . host , options . port ) ;
1251
+ options . agent = new Agent ( options ) ;
1252
1252
}
1253
1253
return exports . _requestFromAgent ( options , cb ) ;
1254
1254
} ;
Original file line number Diff line number Diff line change @@ -26,9 +26,7 @@ exports.createServer = function(opts, requestListener) {
26
26
var agents = { } ;
27
27
28
28
function Agent ( options ) {
29
- http . Agent . call ( this , options . host , options . port ) ;
30
-
31
- this . options = options ;
29
+ http . Agent . call ( this , options ) ;
32
30
}
33
31
inherits ( Agent , http . Agent ) ;
34
32
You can’t perform that action at this time.
0 commit comments