Skip to content

Commit

Permalink
jslint test/simple/test-regress-GH-877.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasMadsen committed Dec 11, 2011
1 parent 987cbe3 commit 8f4b974
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/simple/test-regress-GH-877.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ var server = http.createServer(function(req, res) {
res.end('Hello World\n');
});

var addrString = '127.0.0.1:' + common.PORT;

server.listen(common.PORT, '127.0.0.1', function() {
for (var i = 0; i < N; i++) {
var options = {
Expand All @@ -50,12 +52,14 @@ server.listen(common.PORT, '127.0.0.1', function() {

assert.equal(req.agent, agent);

console.log('Socket: ' + agent.sockets['127.0.0.1:' + common.PORT].length +
'/' + agent.maxSockets +
' queued: ' + (agent.requests['127.0.0.1:' + common.PORT] ? agent.requests['127.0.0.1:' + common.PORT].length : 0));
console.log('Socket: ' + agent.sockets[addrString].length + '/' +
agent.maxSockets + ' queued: ' + (agent.requests[addrString] ?
agent.requests['127.0.0.1:' + common.PORT].length : 0));

var agentRequests = agent.requests[addrString] ? agentRequests.length : 0;

if (maxQueued < (agent.requests['127.0.0.1:' + common.PORT] ? agent.requests['127.0.0.1:' + common.PORT].length : 0)) {
maxQueued = (agent.requests['127.0.0.1:' + common.PORT] ? agent.requests['127.0.0.1:' + common.PORT].length : 0);
if (maxQueued < agentRequests) {
maxQueued = agentRequests;
}
}
});
Expand Down

0 comments on commit 8f4b974

Please sign in to comment.