mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-23 23:45:37 +00:00
MEDIUM: protocol: add a pointer to struct sock_ops to the listener struct
The listener struct is now aware of the socket layer to use upon accept(). At the moment, only sock_raw is supported so this patch should not change anything.
This commit is contained in:
parent
21adb02d19
commit
d88fd824b7
@ -102,6 +102,7 @@ struct listener {
|
|||||||
int options; /* socket options : LI_O_* */
|
int options; /* socket options : LI_O_* */
|
||||||
struct licounters *counters; /* statistics counters */
|
struct licounters *counters; /* statistics counters */
|
||||||
struct protocol *proto; /* protocol this listener belongs to */
|
struct protocol *proto; /* protocol this listener belongs to */
|
||||||
|
struct sock_ops *sock; /* listener socket operations */
|
||||||
int nbconn; /* current number of connections on this listener */
|
int nbconn; /* current number of connections on this listener */
|
||||||
int maxconn; /* maximum connections allowed on this listener */
|
int maxconn; /* maximum connections allowed on this listener */
|
||||||
unsigned int backlog; /* if set, listen backlog */
|
unsigned int backlog; /* if set, listen backlog */
|
||||||
|
@ -265,6 +265,7 @@ static int str2listener(char *str, struct proxy *curproxy, const char *file, int
|
|||||||
|
|
||||||
l->fd = -1;
|
l->fd = -1;
|
||||||
l->addr = ss;
|
l->addr = ss;
|
||||||
|
l->sock = &sock_raw;
|
||||||
l->state = LI_INIT;
|
l->state = LI_INIT;
|
||||||
|
|
||||||
if (ss.ss_family == AF_INET) {
|
if (ss.ss_family == AF_INET) {
|
||||||
|
@ -276,6 +276,7 @@ static int stats_parse_global(char **args, int section_type, struct proxy *curpx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global.stats_sock.sock = &sock_raw;
|
||||||
uxst_add_listener(&global.stats_sock);
|
uxst_add_listener(&global.stats_sock);
|
||||||
global.maxsock++;
|
global.maxsock++;
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
|||||||
s->si[0].flags = SI_FL_CAP_SPLTCP; /* TCP/TCPv6 splicing possible */
|
s->si[0].flags = SI_FL_CAP_SPLTCP; /* TCP/TCPv6 splicing possible */
|
||||||
|
|
||||||
/* add the various callbacks */
|
/* add the various callbacks */
|
||||||
stream_interface_prepare(&s->si[0], &sock_raw);
|
stream_interface_prepare(&s->si[0], l->sock);
|
||||||
|
|
||||||
/* pre-initialize the other side's stream interface to an INIT state. The
|
/* pre-initialize the other side's stream interface to an INIT state. The
|
||||||
* callbacks will be initialized before attempting to connect.
|
* callbacks will be initialized before attempting to connect.
|
||||||
|
Loading…
Reference in New Issue
Block a user