From: Willy Tarreau Date: Mon, 25 Jul 2011 05:08:45 +0000 (+0200) Subject: [MEDIUM] listeners: don't stop proxies when global maxconn is reached X-Git-Tag: v1.5-dev8~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2242649b3a56c8a8a4769220e1f131ac4fddfb61;p=thirdparty%2Fhaproxy.git [MEDIUM] listeners: don't stop proxies when global maxconn is reached Now we don't have to stop proxies anymore since their listeners will be queued if they attempt to accept a connection past the global limits. --- diff --git a/src/proxy.c b/src/proxy.c index 25398a966b..2be137070e 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -482,6 +482,10 @@ void maintain_proxies(int *next) /* if there are enough free sessions, we'll activate proxies */ if (actconn < global.maxconn) { + /* We should periodically try to enable listeners waiting for a + * global resource here. + */ + for (; p; p = p->next) { /* check the various reasons we may find to block the frontend */ if (p->feconn >= p->maxconn) @@ -519,16 +523,6 @@ void maintain_proxies(int *next) } } } - else { /* block all proxies */ - while (p) { - if (p->state == PR_STRUN) { - for (l = p->listen; l != NULL; l = l->next) - disable_listener(l); - p->state = PR_STIDLE; - } - p = p->next; - } - } if (stopping) { struct peers *prs;