]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: protocol: remove the ->disable_all method
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2020 14:30:22 +0000 (16:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:30 +0000 (11:27 +0200)
This one has never been used, is only referenced by proto_uxst and
proto_sockpair, and it's not even certain it works at all. Let's
get rid of it.

include/haproxy/protocol-t.h
src/proto_sockpair.c
src/proto_uxst.c
src/protocol.c

index 2c5b66227ca8d3a071c17c6bc90b43e600cce047..9f790152a17bcd595f259f72728190f2d7381e55 100644 (file)
@@ -87,7 +87,6 @@ struct protocol {
        void (*accept)(int fd);                         /* generic accept function */
        int (*listen)(struct listener *l, char *errmsg, int errlen); /* start a listener */
        int (*enable_all)(struct protocol *proto);      /* enable all bound listeners */
-       int (*disable_all)(struct protocol *proto);     /* disable all bound listeners */
        int (*connect)(struct connection *, int flags); /* connect function if any, see below for flags values */
        int (*drain)(int fd);                           /* indicates whether we can safely close the fd */
        int (*pause)(struct listener *l);               /* temporarily pause this listener for a soft restart */
index eb7ef8697291e6a4212e11c7ca9f6c6b31d099a6..53a44792d9168545de09052e32cbfc78c582ff1e 100644 (file)
@@ -69,7 +69,6 @@ static struct protocol proto_sockpair = {
        .connect = &sockpair_connect_server,
        .listen = sockpair_bind_listener,
        .enable_all = enable_all_listeners,
-       .disable_all = disable_all_listeners,
        .pause = NULL,
        .add = sockpair_add_listener,
        .listeners = LIST_HEAD_INIT(proto_sockpair.listeners),
index c477d193dcc318df4ee53994bca6192355b64912..2b1b0c3c946317d6905430e8d8d6c478d3511a3b 100644 (file)
@@ -57,7 +57,6 @@ static struct protocol proto_unix = {
        .connect = &uxst_connect_server,
        .listen = uxst_bind_listener,
        .enable_all = enable_all_listeners,
-       .disable_all = disable_all_listeners,
        .pause = uxst_pause_listener,
        .add = uxst_add_listener,
        .listeners = LIST_HEAD_INIT(proto_unix.listeners),
index 54b708332729fe38b143ebc7ba72d57cf66caeee..c248929b337bb98c3f77627c348264de1514ef2c 100644 (file)
@@ -215,26 +215,6 @@ int protocol_enable_all(void)
        return err;
 }
 
-/* disables all listeners of all registered protocols. This may be used before
- * a fork() to avoid duplicating poll lists. Returns a composition of ERR_NONE,
- * ERR_RETRYABLE, ERR_FATAL.
- */
-int protocol_disable_all(void)
-{
-       struct protocol *proto;
-       int err;
-
-       err = 0;
-       HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
-       list_for_each_entry(proto, &protocols, list) {
-               if (proto->disable_all) {
-                       err |= proto->disable_all(proto);
-               }
-       }
-       HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
-       return err;
-}
-
 /*
  * Local variables:
  *  c-indent-level: 8