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.
This commit is contained in:
Willy Tarreau 2020-09-25 16:30:22 +02:00
parent e53608b2cd
commit fb4ead8e8a
4 changed files with 0 additions and 23 deletions

View 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 */

View 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),

View 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),

View 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