[minor] Pushing hot-fix from Mikeal for vendored pool repo

This commit is contained in:
indexzero 2010-09-20 20:37:02 -04:00
parent 9128a8c5a1
commit 60791f361f

7
vendor/pool/main.js vendored
View File

@ -20,6 +20,13 @@ sys.inherits(Pool, events.EventEmitter);
Pool.prototype.getClient = function (cb) {
for (var i=0;i<this.clients.length;i+=1) {
if (!this.clients[i].busy) {
// Check if the client closed unexpectedly
if (this.clients[i].readyState === 'closed') {
delete this.clients[i];
this.clients[i] = http.createClient(this.port, this.host, this.https, this.credentials);
this.clients[i].busy = false;
}
if (this.clients.length > this.maxClients) {
this.clients[i].end();
this.clients.splice(i, 1);