]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: config: Don't alter listener->maxaccept when nbproc is set to 1
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 Apr 2019 12:08:41 +0000 (14:08 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 Apr 2019 13:28:29 +0000 (15:28 +0200)
This patch only removes a useless calculation on listener->maxaccept when nbproc
is set to 1. Indeed, the following formula has no effet in such case:

  listener->maxaccept = (listener->maxaccept + nbproc - 1) / nbproc;

This patch may be backported as far as 1.5.

src/cfgparse.c

index 9a03a02bba25d4a7332efd6245a1a7424bbc0df2..48d53e9dd4ae6dccdb0c4a31b2b0a8d9178501bd 100644 (file)
@@ -3728,9 +3728,8 @@ out_uri_auth_compat:
                         * is bound to. Rememeber that maxaccept = -1 must be kept as it is
                         * used to disable the limit.
                         */
-                       if (listener->maxaccept > 0) {
-                               if (nbproc > 1)
-                                       listener->maxaccept = (listener->maxaccept + 1) / 2;
+                       if (listener->maxaccept > 0 && nbproc > 1) {
+                               listener->maxaccept = (listener->maxaccept + 1) / 2;
                                listener->maxaccept = (listener->maxaccept + nbproc - 1) / nbproc;
                        }