mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
MINOR: protocol: directly call enable_listener() from protocol_enable_all()
protocol_enable_all() calls proto->enable_all() for all protocols, which is always equal to enable_all_listeners() which in turn simply is a generic loop calling enable_listener() always returning ERR_NONE. Let's clean this madness by first calling enable_listener() directly from protocol_enable_all().
This commit is contained in:
parent
7834a3f70f
commit
5b95ae6b32
@ -196,23 +196,21 @@ int protocol_resume_all(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* enables all listeners of all registered protocols. This is intended to be
|
/* enables all listeners of all registered protocols. This is intended to be
|
||||||
* used after a fork() to enable reading on all file descriptors. Returns a
|
* used after a fork() to enable reading on all file descriptors. Returns
|
||||||
* composition of ERR_NONE, ERR_RETRYABLE, ERR_FATAL.
|
* composition of ERR_NONE.
|
||||||
*/
|
*/
|
||||||
int protocol_enable_all(void)
|
int protocol_enable_all(void)
|
||||||
{
|
{
|
||||||
struct protocol *proto;
|
struct protocol *proto;
|
||||||
int err;
|
struct listener *listener;
|
||||||
|
|
||||||
err = 0;
|
|
||||||
HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
|
HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
|
||||||
list_for_each_entry(proto, &protocols, list) {
|
list_for_each_entry(proto, &protocols, list) {
|
||||||
if (proto->enable_all) {
|
list_for_each_entry(listener, &proto->listeners, rx.proto_list)
|
||||||
err |= proto->enable_all(proto);
|
enable_listener(listener);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
|
HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
|
||||||
return err;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user