From: William Lallemand Date: Tue, 11 Sep 2018 08:06:20 +0000 (+0200) Subject: MINOR: mworker: mworker_cleanlisteners() delete the listeners X-Git-Tag: v1.9-dev2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91c13b696a4d80c707d1bad2c908cfd65d897bf9;p=thirdparty%2Fhaproxy.git MINOR: mworker: mworker_cleanlisteners() delete the listeners The mworker_cleanlisteners() function now remove the listeners, we don't need them in the master for now. --- diff --git a/src/haproxy.c b/src/haproxy.c index 6504e96fe9..1ab87b7267 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -550,17 +550,15 @@ static void mworker_cleanlisteners() curpeers->peers_fe = NULL; } + for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) { list_for_each_entry_safe(l, l_next, &curproxy->conf.listeners, by_fe) { /* does not close if the FD is inherited with fd@ * from the parent process */ - if (!(l->options & LI_O_INHERITED)) { - close(l->fd); - LIST_DEL(&l->by_fe); - LIST_DEL(&l->by_bind); - free(l->name); - free(l->counters); - free(l); - } + if (!(l->options & LI_O_INHERITED)) + unbind_listener(l); + /* remove the listener, but we might want to keep some + * for the master in the future... */ + delete_listener(l); } } }