aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-01 15:49:39 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-07-01 15:49:42 -0700
commitefca5456b8dd3e94b3af02ccaf94d032ded6a48c (patch)
treeb1bbab1ec587d9435cc14a850fd1ab6010851c1a /lib
parentf78f654131ae6d119110322e82484acf567e4f72 (diff)
downloadandroid-node-v8-efca5456b8dd3e94b3af02ccaf94d032ded6a48c.tar.gz
android-node-v8-efca5456b8dd3e94b3af02ccaf94d032ded6a48c.tar.bz2
android-node-v8-efca5456b8dd3e94b3af02ccaf94d032ded6a48c.zip
Fixes #877. Don't wait for socket pool to establish connections.
Thanks to Yann Biancheri for putting together an initial test.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.js12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/http.js b/lib/http.js
index 4f9d61203d..3bb24cbef7 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -1152,12 +1152,6 @@ Agent.prototype.appendMessage = function(options) {
this.queue.push(req);
req._queue = this.queue;
- /*
- req.on('finish', function () {
- self._cycle();
- });
- */
-
this._cycle();
return req;
@@ -1374,8 +1368,6 @@ Agent.prototype._cycle = function() {
var first = this.queue[0];
if (!first) return;
- var haveConnectingSocket = false;
-
// First try to find an available socket.
for (var i = 0; i < this.sockets.length; i++) {
var socket = this.sockets[i];
@@ -1395,13 +1387,11 @@ Agent.prototype._cycle = function() {
self._cycle(); // try to dispatch another
return;
}
-
- if (socket._httpConnecting) haveConnectingSocket = true;
}
// If no sockets are connecting, and we have space for another we should
// be starting a new connection to handle this request.
- if (!haveConnectingSocket && this.sockets.length < this.maxSockets) {
+ if (this.sockets.length < this.maxSockets) {
this._establishNewConnection();
}