From: willy tarreau Date: Sun, 21 May 2006 20:07:31 +0000 (+0200) Subject: [MINOR] always ensure that minconn < maxconn or override it. X-Git-Tag: v1.2.14~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b598cc00a544faeb5907075e1c231fed9bd1382;p=thirdparty%2Fhaproxy.git [MINOR] always ensure that minconn < maxconn or override it. --- diff --git a/haproxy.c b/haproxy.c index 586978a0a3..4910b5e568 100644 --- 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; }