mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[minor] Pushing hot-fix from Mikeal for vendored pool repo
This commit is contained in:
parent
9128a8c5a1
commit
60791f361f
7
vendor/pool/main.js
vendored
7
vendor/pool/main.js
vendored
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user