diff options
author | Willy Tarreau <w@1wt.eu> | 2020-10-07 16:20:34 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2020-10-07 19:42:32 +0200 |
commit | 3a2bab14ea2dc2af10038e73bd8832e0366fc0e7 (patch) | |
tree | 5241d6551ed459f68be409a86dd6d56ed92cd90a | |
parent | a426bfd85edeb9cac81f86e4ecc640f36a13c91e (diff) | |
download | haproxy-3a2bab14ea2dc2af10038e73bd8832e0366fc0e7.tar.gz |
MEDIUM: proxy: make stop_proxy() now use stop_listener()
The function will stop the listeners using this method, which in turn will
ping back once it finishes disabling the proxy.
-rw-r--r-- | src/proxy.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/proxy.c b/src/proxy.c index 7b000bb23..247ee6366 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1300,28 +1300,8 @@ void stop_proxy(struct proxy *p) HA_SPIN_LOCK(PROXY_LOCK, &p->lock); - list_for_each_entry(l, &p->conf.listeners, by_fe) { - if (l->options & LI_O_NOSTOP) { - HA_ATOMIC_ADD(&unstoppable_jobs, 1); - continue; - } - - /* There are several cases where we must not close an FD: - * - we're starting up and we have socket transfers enabled; - * - we're the master and this FD was inherited; - */ - if ((global.tune.options & GTUNE_SOCKET_TRANSFER && global.mode & MODE_STARTING) || - (master && (l->rx.flags & RX_F_INHERITED))) - unbind_listener_no_close(l); - else - unbind_listener(l); - - if (l->state >= LI_ASSIGNED) - delete_listener(l); - } - - if (p->li_ready + p->li_bound + p->li_paused == 0) - p->disabled = 1; + list_for_each_entry(l, &p->conf.listeners, by_fe) + stop_listener(l, 1, 0, 0); HA_SPIN_UNLOCK(PROXY_LOCK, &p->lock); } |