]> git.ipfire.org Git - thirdparty/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>
Sat, 16 Aug 2008 16:41:13 +0000 (18:41 +0200)
maintain_proxies could disable backends (p->maxconn == 0) which is
wrong (but apparently harmless). Add a check for p->maxconn == 0.

src/proxy.c

index 17728f5ac0d5474f6d19b55180c59203e3e13372..0554033572591c8c883f86c024ffd13b8e1ee538 100644 (file)
@@ -314,7 +314,7 @@ void maintain_proxies(int *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);