]> git.kaiwu.me - haproxy.git/commitdiff
[BUG] maintain_proxies must not disable backends
authorWilly Tarreau <w@1wt.eu>
Sat, 16 Aug 2008 16:41:13 +0000 (18:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Sep 2008 09:13:46 +0000 (11:13 +0200)
maintain_proxies could disable backends (p->maxconn == 0) which is
wrong (but apparently harmless). Add a check for p->maxconn == 0.
(cherry picked from commit d5382b4aaa099ce5ce2af5828bd4d6dc38e9e8ea)
(cherry picked from commit 2f9127b4b91de1ac685498e145f29342115bcb71)

src/proxy.c

index 7019606f0ddcf2a346963849d0a8985e787cb351..83ef1d59925358e63b28b55e9961b6c2d2c83411 100644 (file)
@@ -279,7 +279,7 @@ void maintain_proxies(struct timeval *next)
        /* if there are enough free sessions, we'll activate proxies */
        if (actconn < global.maxconn) {
                while (p) {
-                       if (p->feconn < p->maxconn) {
+                       if (!p->maxconn || p->feconn < p->maxconn) {
                                if (p->state == PR_STIDLE) {
                                        for (l = p->listen; l != NULL; l = l->next)
                                                enable_listener(l);