Skip to content

Commit

Permalink
[minor] Pushing hot-fix from Mikeal for vendored pool repo
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Sep 21, 2010
1 parent 9128a8c commit 60791f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vendor/pool/main.js
Expand Up @@ -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);
Expand Down

0 comments on commit 60791f3

Please sign in to comment.