Agent: Each time an http req is sent to a socket, _cycle to try to dispatch
another. Problem became apparent in 4612b0 when we wait for connecting
sockets.
// start the process of establishing one.
Agent.prototype._cycle = function() {
debug("Agent _cycle sockets=" + this.sockets.length + " queue=" + this.queue.length);
+ var self = this;
var first = this.queue[0];
if (!first) return;
// We found an available connection!
this.queue.shift(); // remove first from queue.
first.assignSocket(socket);
+ self._cycle(); // try to dispatch another
return;
}