Commit 60791f36 authored by indexzero's avatar indexzero

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

parent 9128a8c5
...@@ -20,6 +20,13 @@ sys.inherits(Pool, events.EventEmitter); ...@@ -20,6 +20,13 @@ sys.inherits(Pool, events.EventEmitter);
Pool.prototype.getClient = function (cb) { Pool.prototype.getClient = function (cb) {
for (var i=0;i<this.clients.length;i+=1) { for (var i=0;i<this.clients.length;i+=1) {
if (!this.clients[i].busy) { 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) { if (this.clients.length > this.maxClients) {
this.clients[i].end(); this.clients[i].end();
this.clients.splice(i, 1); this.clients.splice(i, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment