mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-14 15:34:35 +00:00
MINOR: listeners: check the current listener state in pause_listener()
It's better not to try to perform pause() actions on wrong states, so let's check this and make sure that all callers are now safe. This means that we must not try to pause a listener which is already paused (e.g. it could possibly fail if the pause operation isn't idempotent at the socket level), nor should we try it on earlier states.
This commit is contained in:
parent
337c835d16
commit
9b3a932777
@ -343,6 +343,9 @@ int pause_listener(struct listener *l)
|
||||
!(proc_mask(l->rx.settings->bind_proc) & pid_bit))
|
||||
goto end;
|
||||
|
||||
if (l->state <= LI_PAUSED)
|
||||
goto end;
|
||||
|
||||
if (l->rx.proto->pause) {
|
||||
/* Returns < 0 in case of failure, 0 if the listener
|
||||
* was totally stopped, or > 0 if correctly paused.
|
||||
|
Loading…
Reference in New Issue
Block a user