summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-09-23 18:16:03 +0200
committerWilly Tarreau <w@1wt.eu>2020-10-07 18:44:08 +0200
commit3aa92a71bbd5e3dc10e276dd4864d0da09d16349 (patch)
treee3a991ec962b5f0cde884aef8d375cdb2109a844
parent3ed9539d51ce1714ecb114d0487019b34ddade21 (diff)
downloadhaproxy-3aa92a71bbd5e3dc10e276dd4864d0da09d16349.tar.gz
CLEANUP: proxy: remove the first_to_listen hack in zombify_proxy()
This thing was needed for an optimization used in soft_stop() which doesn't exist anymore, so let's remove it as it's cryptic and hinders the listeners cleanup.
-rw-r--r--src/proxy.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/proxy.c b/src/proxy.c
index d5af92fc0..a901f53ad 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1326,33 +1326,12 @@ int pause_proxy(struct proxy *p)
void zombify_proxy(struct proxy *p)
{
struct listener *l;
- struct listener *first_to_listen = NULL;
list_for_each_entry(l, &p->conf.listeners, by_fe) {
- enum li_state oldstate = l->state;
-
unbind_listener_no_close(l);
- if (l->state >= LI_ASSIGNED) {
+ if (l->state >= LI_ASSIGNED)
delete_listener(l);
- }
- /*
- * Pretend we're still up and running so that the fd
- * will be sent if asked.
- */
- if (!first_to_listen && oldstate >= LI_LISTEN)
- first_to_listen = l;
}
- /* Quick hack : at stop time, to know we have to close the sockets
- * despite the proxy being marked as stopped, make the first listener
- * of the listener list an active one, so that we don't have to
- * parse the whole list to be sure.
- */
- if (first_to_listen && LIST_ELEM(p->conf.listeners.n,
- struct listener *, by_fe) != first_to_listen) {
- LIST_DEL(&l->by_fe);
- LIST_ADD(&p->conf.listeners, &l->by_fe);
- }
-
p->state = PR_STSTOPPED;
}