mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MINOR: protocol: add a new pair of rx_enable/rx_disable methods
These methods will be used to enable/disable rx at the receiver level so that callers don't play with FDs directly anymore. All our protocols use the generic ones from sock.c at the moment. For now they're not used.
This commit is contained in:
parent
e70c7977f2
commit
686fa3db50
@ -91,6 +91,8 @@ struct protocol {
|
||||
int (*listen)(struct listener *l, char *errmsg, int errlen); /* start a listener */
|
||||
|
||||
/* functions acting on the receiver */
|
||||
void (*rx_enable)(struct receiver *rx); /* enable receiving on the receiver */
|
||||
void (*rx_disable)(struct receiver *rx); /* disable receiving on the receiver */
|
||||
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 */
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <haproxy/listener.h>
|
||||
#include <haproxy/protocol.h>
|
||||
#include <haproxy/proto_sockpair.h>
|
||||
#include <haproxy/sock.h>
|
||||
#include <haproxy/time.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/version.h>
|
||||
@ -67,6 +68,8 @@ static struct protocol proto_sockpair = {
|
||||
.sock_prot = 0,
|
||||
.add = sockpair_add_listener,
|
||||
.listen = sockpair_bind_listener,
|
||||
.rx_enable = sock_enable,
|
||||
.rx_disable = sock_disable,
|
||||
.accept = &listener_accept,
|
||||
.connect = &sockpair_connect_server,
|
||||
.receivers = LIST_HEAD_INIT(proto_sockpair.receivers),
|
||||
|
@ -60,6 +60,8 @@ static struct protocol proto_tcpv4 = {
|
||||
.sock_prot = IPPROTO_TCP,
|
||||
.add = tcpv4_add_listener,
|
||||
.listen = tcp_bind_listener,
|
||||
.rx_enable = sock_enable,
|
||||
.rx_disable = sock_disable,
|
||||
.rx_suspend = tcp_suspend_receiver,
|
||||
.rx_resume = tcp_resume_receiver,
|
||||
.accept = &listener_accept,
|
||||
@ -80,6 +82,8 @@ static struct protocol proto_tcpv6 = {
|
||||
.sock_prot = IPPROTO_TCP,
|
||||
.add = tcpv6_add_listener,
|
||||
.listen = tcp_bind_listener,
|
||||
.rx_enable = sock_enable,
|
||||
.rx_disable = sock_disable,
|
||||
.rx_suspend = tcp_suspend_receiver,
|
||||
.rx_resume = tcp_resume_receiver,
|
||||
.accept = &listener_accept,
|
||||
|
@ -55,6 +55,8 @@ static struct protocol proto_udp4 = {
|
||||
.sock_prot = IPPROTO_UDP,
|
||||
.add = udp4_add_listener,
|
||||
.listen = udp_bind_listener,
|
||||
.rx_enable = sock_enable,
|
||||
.rx_disable = sock_disable,
|
||||
.rx_suspend = udp_suspend_receiver,
|
||||
.receivers = LIST_HEAD_INIT(proto_udp4.receivers),
|
||||
.nb_receivers = 0,
|
||||
@ -72,6 +74,8 @@ static struct protocol proto_udp6 = {
|
||||
.sock_prot = IPPROTO_UDP,
|
||||
.add = udp6_add_listener,
|
||||
.listen = udp_bind_listener,
|
||||
.rx_enable = sock_enable,
|
||||
.rx_disable = sock_disable,
|
||||
.rx_suspend = udp_suspend_receiver,
|
||||
.receivers = LIST_HEAD_INIT(proto_udp6.receivers),
|
||||
.nb_receivers = 0,
|
||||
|
@ -55,6 +55,8 @@ static struct protocol proto_unix = {
|
||||
.sock_prot = 0,
|
||||
.add = uxst_add_listener,
|
||||
.listen = uxst_bind_listener,
|
||||
.rx_enable = sock_enable,
|
||||
.rx_disable = sock_disable,
|
||||
.rx_suspend = uxst_suspend_receiver,
|
||||
.accept = &listener_accept,
|
||||
.connect = &uxst_connect_server,
|
||||
|
Loading…
x
Reference in New Issue
Block a user