You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.3 KiB

  1. commit c6e03c1495fa51f9a98ed0bbe3230313c7c7201c
  2. Author: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Tue Apr 30 14:08:41 2019 +0200
  4. CLEANUP: config: Don't alter listener->maxaccept when nbproc is set to 1
  5. This patch only removes a useless calculation on listener->maxaccept when nbproc
  6. is set to 1. Indeed, the following formula has no effet in such case:
  7. listener->maxaccept = (listener->maxaccept + nbproc - 1) / nbproc;
  8. This patch may be backported as far as 1.5.
  9. (cherry picked from commit 02f3cf19ed803d20aff9294ce7cb732489951ff5)
  10. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  11. (cherry picked from commit 14203e3cf9404e57de5e274b453f0fe4f2174924)
  12. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  13. diff --git a/src/cfgparse.c b/src/cfgparse.c
  14. index 8e325416..3f6ea352 100644
  15. --- a/src/cfgparse.c
  16. +++ b/src/cfgparse.c
  17. @@ -9018,9 +9018,8 @@ out_uri_auth_compat:
  18. * is bound to. Rememeber that maxaccept = -1 must be kept as it is
  19. * used to disable the limit.
  20. */
  21. - if (listener->maxaccept > 0) {
  22. - if (nbproc > 1)
  23. - listener->maxaccept = (listener->maxaccept + 1) / 2;
  24. + if (listener->maxaccept > 0 && nbproc > 1) {
  25. + listener->maxaccept = (listener->maxaccept + 1) / 2;
  26. listener->maxaccept = (listener->maxaccept + nbproc - 1) / nbproc;
  27. }