diff --git a/include/haproxy/protocol-t.h b/include/haproxy/protocol-t.h index 2dea7326e..ae7ec1975 100644 --- a/include/haproxy/protocol-t.h +++ b/include/haproxy/protocol-t.h @@ -101,6 +101,7 @@ struct protocol { void (*rx_unbind)(struct receiver *rx); /* unbind the receiver, most often closing the FD */ int (*rx_suspend)(struct receiver *rx); /* temporarily suspend this receiver for a soft restart */ int (*rx_resume)(struct receiver *rx); /* try to resume a temporarily suspended receiver */ + int (*rx_listening)(const struct receiver *rx); /* is the receiver listening ? 0=no, >0=OK, <0=unrecoverable */ /* functions acting on connections */ void (*accept)(int fd); /* generic accept function */ diff --git a/src/proto_tcp.c b/src/proto_tcp.c index aadac7c07..fbc99c939 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -72,6 +72,7 @@ static struct protocol proto_tcpv4 = { .rx_unbind = sock_unbind, .rx_suspend = tcp_suspend_receiver, .rx_resume = tcp_resume_receiver, + .rx_listening = sock_accept_conn, .accept = &listener_accept, .connect = tcp_connect_server, .receivers = LIST_HEAD_INIT(proto_tcpv4.receivers), @@ -100,6 +101,7 @@ static struct protocol proto_tcpv6 = { .rx_unbind = sock_unbind, .rx_suspend = tcp_suspend_receiver, .rx_resume = tcp_resume_receiver, + .rx_listening = sock_accept_conn, .accept = &listener_accept, .connect = tcp_connect_server, .receivers = LIST_HEAD_INIT(proto_tcpv6.receivers), diff --git a/src/proto_uxst.c b/src/proto_uxst.c index 047b75954..d9d5a07b0 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -65,6 +65,7 @@ static struct protocol proto_unix = { .rx_disable = sock_disable, .rx_unbind = sock_unbind, .rx_suspend = uxst_suspend_receiver, + .rx_listening = sock_accept_conn, .accept = &listener_accept, .connect = &uxst_connect_server, .receivers = LIST_HEAD_INIT(proto_unix.receivers),