]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: config: set the maxaccept value for peers listeners earlier
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Jan 2013 09:51:07 +0000 (10:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 May 2014 20:12:24 +0000 (22:12 +0200)
Since we introduced bind_conf in peers, we can set maxaccept in a cleaner
way at the proper time, let's do this to make the code more readable.

src/cfgparse.c

index 1cdda34d1f7efe9f05abfa9c9ba9bf1f2c07485c..6b1034e7dbc7c707b0d890b3772d8fcd7d55bc94 100644 (file)
@@ -1757,6 +1757,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
                                }
 
                                list_for_each_entry(l, &bind_conf->listeners, by_bind) {
+                                       l->maxaccept = 1;
                                        l->maxconn = ((struct proxy *)curpeers->peers_fe)->maxconn;
                                        l->backlog = ((struct proxy *)curpeers->peers_fe)->backlog;
                                        l->timeout = &((struct proxy *)curpeers->peers_fe)->timeout.client;
@@ -7076,7 +7077,6 @@ out_uri_auth_compat:
                while (*last) {
                        curpeers = *last;
                        if (curpeers->peers_fe) {
-                               LIST_NEXT(&curpeers->peers_fe->conf.listeners, struct listener *, by_fe)->maxaccept = 1;
                                last = &curpeers->next;
                                continue;
                        }