]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mworker: mworker_cleanlisteners() delete the listeners
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 11 Sep 2018 08:06:20 +0000 (10:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Sep 2018 08:21:58 +0000 (10:21 +0200)
The mworker_cleanlisteners() function now remove the listeners, we don't
need them in the master for now.

src/haproxy.c

index 6504e96fe98d4e4a3e14b3f922141a79ed9fa5a5..1ab87b7267068cd3a9b590a3b8f082d05bad81da 100644 (file)
@@ -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);
                }
        }
 }