From: Willy Tarreau Date: Fri, 25 Sep 2020 14:30:22 +0000 (+0200) Subject: CLEANUP: protocol: remove the ->disable_all method X-Git-Tag: v2.3-dev6~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb4ead8e8ac86007a21ee5295cc3fc56196dd321;p=thirdparty%2Fhaproxy.git CLEANUP: protocol: remove the ->disable_all method 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. --- diff --git a/include/haproxy/protocol-t.h b/include/haproxy/protocol-t.h index 2c5b66227c..9f790152a1 100644 --- a/include/haproxy/protocol-t.h +++ b/include/haproxy/protocol-t.h @@ -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 */ diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c index eb7ef86972..53a44792d9 100644 --- a/src/proto_sockpair.c +++ b/src/proto_sockpair.c @@ -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), diff --git a/src/proto_uxst.c b/src/proto_uxst.c index c477d193dc..2b1b0c3c94 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -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), diff --git a/src/protocol.c b/src/protocol.c index 54b7083327..c248929b33 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -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