]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: proxy: make stop_proxy() now use stop_listener()
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Oct 2020 14:20:34 +0000 (16:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 16:28:18 +0000 (18:28 +0200)
The function will stop the listeners using this method, which in turn will
ping back once it finishes disabling the proxy.

src/proxy.c

index 058e33131bf6a8d4adb5b2be0f7c9655a1417662..247ee6366cfd70b5895fc5eee4dff36f06adf1d2 100644 (file)
@@ -1300,26 +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)
-                       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);
 }