Comparing version 0.0.6 to 0.0.7
@@ -197,2 +197,4 @@ /* | ||
exposeGlobalTimers(config); | ||
//set MaxSocket at module load time coz its used for http client request | ||
setDefaultMaxSockets(config); | ||
} | ||
@@ -224,2 +226,3 @@ | ||
//Set it again since a incoming request can have a different config value for max-socket | ||
setDefaultMaxSockets(conf); | ||
@@ -226,0 +229,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Vinit Sacheti<vsacheti@yahoo-inc.com>", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"devDependencies": { | ||
@@ -8,0 +8,0 @@ "ytestrunner": "*", |
@@ -413,5 +413,33 @@ var http = require('http'), | ||
}, | ||
'Verify that globalAgent maxSockets is set' : function() { | ||
http.globalAgent.maxSockets = 10; | ||
var testee = mod_limits({ | ||
"enable" : "true", | ||
"max_sockets" : 0 | ||
}); | ||
Assert.areEqual(10, http.globalAgent.maxSockets); | ||
testee = mod_limits({ | ||
"enable" : "true", | ||
"max_sockets" : 100 | ||
}); | ||
Assert.areEqual(100, http.globalAgent.maxSockets); | ||
var req = getReq(), | ||
resp = getResp(), | ||
next = false; | ||
req.mod_config = { | ||
"max_sockets" : 1000 | ||
} | ||
testee(req, resp, function() { | ||
next = true; | ||
}); | ||
Assert.areEqual(1000, http.globalAgent.maxSockets); | ||
} | ||
})); | ||
// vim:ts=4 sw=4 et |
Sorry, the diff of this file is not supported yet
25398
614