CLEANUP: protocol: remove the ->enable_all method
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2020 14:45:12 +0000 (16:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:30 +0000 (11:27 +0200)
It's not used anymore, now the listeners are enabled from
protocol_enable_all().

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

index 9f79015..bf66dc2 100644 (file)
@@ -74,8 +74,7 @@ struct proto_fam {
 
 /* This structure contains all information needed to easily handle a protocol.
  * Its primary goal is to ease listeners maintenance. Specifically, the
- * bind() primitive must be used before any fork(), and the enable_all()
- * primitive must be called after the fork() to enable all fds.
+ * bind() primitive must be used before any fork().
  */
 struct protocol {
        char name[PROTO_NAME_LEN];                      /* protocol name, zero-terminated */
@@ -86,7 +85,6 @@ struct protocol {
        int sock_prot;                                  /* socket protocol, as passed to socket() */
        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 (*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 53a4479..c77308f 100644 (file)
@@ -68,7 +68,6 @@ static struct protocol proto_sockpair = {
        .accept = &listener_accept,
        .connect = &sockpair_connect_server,
        .listen = sockpair_bind_listener,
-       .enable_all = enable_all_listeners,
        .pause = NULL,
        .add = sockpair_add_listener,
        .listeners = LIST_HEAD_INIT(proto_sockpair.listeners),
index b9bc97e..4e6d36a 100644 (file)
@@ -59,7 +59,6 @@ static struct protocol proto_tcpv4 = {
        .accept = &listener_accept,
        .connect = tcp_connect_server,
        .listen = tcp_bind_listener,
-       .enable_all = enable_all_listeners,
        .pause = tcp_pause_listener,
        .add = tcpv4_add_listener,
        .listeners = LIST_HEAD_INIT(proto_tcpv4.listeners),
@@ -79,7 +78,6 @@ static struct protocol proto_tcpv6 = {
        .accept = &listener_accept,
        .connect = tcp_connect_server,
        .listen = tcp_bind_listener,
-       .enable_all = enable_all_listeners,
        .pause = tcp_pause_listener,
        .add = tcpv6_add_listener,
        .listeners = LIST_HEAD_INIT(proto_tcpv6.listeners),
index af75cc9..aa2416f 100644 (file)
@@ -55,7 +55,6 @@ static struct protocol proto_udp4 = {
        .accept = NULL,
        .connect = NULL,
        .listen = udp_bind_listener,
-       .enable_all = enable_all_listeners,
        .pause = udp_pause_listener,
        .add = udp4_add_listener,
        .listeners = LIST_HEAD_INIT(proto_udp4.listeners),
@@ -75,7 +74,6 @@ static struct protocol proto_udp6 = {
        .accept = NULL,
        .connect = NULL,
        .listen = udp_bind_listener,
-       .enable_all = enable_all_listeners,
        .pause = udp_pause_listener,
        .add = udp6_add_listener,
        .listeners = LIST_HEAD_INIT(proto_udp6.listeners),
index 2b1b0c3..96d96b3 100644 (file)
@@ -56,7 +56,6 @@ static struct protocol proto_unix = {
        .accept = &listener_accept,
        .connect = &uxst_connect_server,
        .listen = uxst_bind_listener,
-       .enable_all = enable_all_listeners,
        .pause = uxst_pause_listener,
        .add = uxst_add_listener,
        .listeners = LIST_HEAD_INIT(proto_unix.listeners),