MINOR: listeners: add a new stop_listener() function
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Oct 2020 13:58:50 +0000 (15:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 16:27:48 +0000 (18:27 +0200)
commitcaa7df1296b71f891f166ae9b3dbfcc9b0886aae
tree8d9f92a07398dcf275120c60a4e84f68d9164e3b
parent455585e3cdaa85471b50402cde26dd63c81fa3ea
MINOR: listeners: add a new stop_listener() function

This function will be used to definitely stop a listener (e.g. during a
soft_stop). This is actually tricky because it may be called for a proxy
or for a protocol, both of which require locks and already hold some. The
function takes booleans indicating which ones are already held, hoping
this will be enough. It's not well defined wether proto->disable() and
proto->rx_disable() are supposed to be called with any lock held, and
they are used from do_unbind_listener() with all these locks. Some back
annotations ought to be added on this point.

The proxy's listeners count is updated, and the proxy is marked as
disabled and woken up after the last one is gone. Note that a
listener in listen state is already not attached anymore since it
was disabled.
include/haproxy/listener.h
src/listener.c