From: Willy Tarreau Date: Thu, 24 Sep 2020 16:54:11 +0000 (+0200) Subject: MINOR: listeners: check the current listener earlier state in resume_listener() X-Git-Tag: v2.3-dev6~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d7f9ce83123ece0245994b6c07298c872111cc9;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/listener.c b/src/listener.c index 6370a9f30b..6327949a15 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;