mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
[MINOR] add an options field to the listeners
This commit is contained in:
parent
8ced9a4b91
commit
6fb42e0694
@ -35,6 +35,7 @@
|
|||||||
#define ERR_WARN 0x08 /* a warning message has been returned */
|
#define ERR_WARN 0x08 /* a warning message has been returned */
|
||||||
#define ERR_ALERT 0x10 /* an alert message has been returned */
|
#define ERR_ALERT 0x10 /* an alert message has been returned */
|
||||||
|
|
||||||
|
#define ERR_CODE (ERR_RETRYABLE|ERR_FATAL|ERR_ABORT) /* mask */
|
||||||
|
|
||||||
#endif /* _COMMON_ERRORS_H */
|
#endif /* _COMMON_ERRORS_H */
|
||||||
|
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
#define LI_READY 3 /* started, listening and enabled */
|
#define LI_READY 3 /* started, listening and enabled */
|
||||||
#define LI_FULL 4 /* reached its connection limit */
|
#define LI_FULL 4 /* reached its connection limit */
|
||||||
|
|
||||||
|
/* listener socket options */
|
||||||
|
#define LI_O_NONE 0x0000
|
||||||
|
#define LI_O_NOLINGER 0x0001 /* disable linger on this socket */
|
||||||
|
|
||||||
/* The listener will be directly referenced by the fdtab[] which holds its
|
/* The listener will be directly referenced by the fdtab[] which holds its
|
||||||
* socket. The listener provides the protocol-specific accept() function to
|
* socket. The listener provides the protocol-specific accept() function to
|
||||||
* the fdtab.
|
* the fdtab.
|
||||||
@ -47,6 +51,7 @@
|
|||||||
struct listener {
|
struct listener {
|
||||||
int fd; /* the listen socket */
|
int fd; /* the listen socket */
|
||||||
int state; /* state: NEW, INIT, LISTEN, READY, FULL */
|
int state; /* state: NEW, INIT, LISTEN, READY, FULL */
|
||||||
|
int options; /* socket options : LI_O_* */
|
||||||
struct sockaddr_storage addr; /* the address we listen to */
|
struct sockaddr_storage addr; /* the address we listen to */
|
||||||
struct protocol *proto; /* protocol this listener belongs to */
|
struct protocol *proto; /* protocol this listener belongs to */
|
||||||
int nbconn; /* current number of connections on this listener */
|
int nbconn; /* current number of connections on this listener */
|
||||||
|
@ -76,6 +76,7 @@ int stats_parse_global(const char **args, char *err, int errlen)
|
|||||||
memcpy(&global.stats_sock.addr, &su, sizeof(su)); // guaranteed to fit
|
memcpy(&global.stats_sock.addr, &su, sizeof(su)); // guaranteed to fit
|
||||||
|
|
||||||
global.stats_sock.state = LI_INIT;
|
global.stats_sock.state = LI_INIT;
|
||||||
|
global.stats_sock.options = LI_O_NONE;
|
||||||
global.stats_sock.accept = uxst_event_accept;
|
global.stats_sock.accept = uxst_event_accept;
|
||||||
global.stats_sock.handler = process_uxst_stats;
|
global.stats_sock.handler = process_uxst_stats;
|
||||||
global.stats_sock.private = NULL;
|
global.stats_sock.private = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user