diff options
author | Willy Tarreau <w@1wt.eu> | 2020-09-24 18:54:11 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2020-10-07 18:45:03 +0200 |
commit | fcbdae37e2fbfe9d51596ad49c6d12e1670a2b9d (patch) | |
tree | 9ff34d552d761ee5de12c1b95e538e9e3d699a63 | |
parent | 9bdcbc499ab2976c9421541e16f3721f27bae099 (diff) | |
download | haproxy-fcbdae37e2fbfe9d51596ad49c6d12e1670a2b9d.tar.gz |
MINOR: listeners: check the current listener earlier state in resume_listener()
It's quite confusing to have the test on LI_READY very low in the function
as it should be made much earlier. Just like with previous commit, let's
do it when entering. The additional states, however (limited, full) continue
to go through the whole function.
-rw-r--r-- | src/listener.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/listener.c b/src/listener.c index 24647a2f4..1518e228a 100644 --- a/src/listener.c +++ b/src/listener.c @@ -395,6 +395,9 @@ int resume_listener(struct listener *l) !(proc_mask(l->rx.settings->bind_proc) & pid_bit)) goto end; + if (l->state == LI_READY) + goto end; + if (l->state == LI_ASSIGNED) { char msg[100]; int err; @@ -423,9 +426,6 @@ int resume_listener(struct listener *l) goto end; } - if (l->state == LI_READY) - goto end; - if (l->maxconn && l->nbconn >= l->maxconn) { listener_set_state(l, LI_FULL); goto end; |