]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: listeners: make the accept loop more robust when maxaccept==0
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2012 19:11:45 +0000 (20:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2012 19:22:10 +0000 (20:22 +0100)
If some listeners are mistakenly configured with 0 as the maxaccept value,
then we now consider them as limited to one accept() at a time. This will
avoid some issues as fixed by the past commit.

src/listener.c

index 7af9adc9b4c1843d97dae6e2bf0b8b76d3ea1a78..22e386e3ae7de844c97642a627ac2531c6bef393 100644 (file)
@@ -252,7 +252,7 @@ void listener_accept(int fd)
 {
        struct listener *l = fdtab[fd].owner;
        struct proxy *p = l->frontend;
-       int max_accept = l->maxaccept;
+       int max_accept = l->maxaccept ? l->maxaccept : 1;
        int cfd;
        int ret;