]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] always ensure that minconn < maxconn or override it.
authorwilly tarreau <willy@wtap.(none)>
Sun, 21 May 2006 20:07:31 +0000 (22:07 +0200)
committerwilly tarreau <willy@wtap.(none)>
Sun, 21 May 2006 20:07:31 +0000 (22:07 +0200)
haproxy.c

index 586978a0a3c0ec65ed450c43312ff9f8e0e0add1..4910b5e568fe0dc794eecb6c791074b8b0f88ead 100644 (file)
--- a/haproxy.c
+++ b/haproxy.c
@@ -9465,8 +9465,11 @@ int readcfgfile(char *file) {
         */
        newsrv = curproxy->srv;
        while (newsrv != NULL) {
-           if (newsrv->minconn && !newsrv->maxconn) {
-               /* only 'minconn' was specified. Let's turn this into maxconn */
+           if (newsrv->minconn >= newsrv->maxconn) {
+               /* Only 'minconn' was specified, or it was higher than or equal
+                * to 'maxconn'. Let's turn this into maxconn and clean it, as
+                * this will avoid further useless expensive computations.
+                */
                newsrv->maxconn = newsrv->minconn;
                newsrv->minconn = 0;
            }