]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: startup: don't rely on PR_STNEW to check for listeners
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Sep 2020 06:15:48 +0000 (08:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:30 +0000 (11:27 +0200)
Instead of looking at listeners in proxies in PR_STNEW state, we'd
rather check for listeners in those not in PR_STSTOPPED as it's only
this state which indicates the proxy was disabled. And let's check
the listeners count instead of testing the list's head.

src/haproxy.c

index 69f4f20b4df928b371b0ffb20f8c1374261c37ec..aa865f0f84f9a902d67c3604f8dfc0238a1d0465 100644 (file)
@@ -2010,7 +2010,7 @@ static void init(int argc, char **argv)
                                break;
 
                for (px = proxies_list; px; px = px->next)
-                       if (px->state == PR_STNEW && !LIST_ISEMPTY(&px->conf.listeners))
+                       if (px->state != PR_STSTOPPED && px->li_all)
                                break;
 
                if (pr || px) {