mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
MINOR: listener: move the NOQUICKACK option to the bind_conf
It solely depends on the bind line so let's move it there under the name BC_O_NOQUICKACK.
This commit is contained in:
parent
cfb7c2f515
commit
9bdcf42922
@ -94,7 +94,7 @@ enum li_status {
|
|||||||
#define LI_O_NONE 0x0000
|
#define LI_O_NONE 0x0000
|
||||||
/* unused 0x0001 */
|
/* unused 0x0001 */
|
||||||
/* unused 0x0002 */
|
/* unused 0x0002 */
|
||||||
#define LI_O_NOQUICKACK 0x0004 /* disable quick ack of immediate data (linux) */
|
/* unused 0x0004 */
|
||||||
#define LI_O_DEF_ACCEPT 0x0008 /* wait up to 1 second for data before accepting */
|
#define LI_O_DEF_ACCEPT 0x0008 /* wait up to 1 second for data before accepting */
|
||||||
#define LI_O_TCP_L4_RULES 0x0010 /* run TCP L4 rules checks on the incoming connection */
|
#define LI_O_TCP_L4_RULES 0x0010 /* run TCP L4 rules checks on the incoming connection */
|
||||||
#define LI_O_TCP_L5_RULES 0x0020 /* run TCP L5 rules checks on the incoming session */
|
#define LI_O_TCP_L5_RULES 0x0020 /* run TCP L5 rules checks on the incoming session */
|
||||||
@ -122,6 +122,7 @@ enum li_status {
|
|||||||
#define BC_O_USE_XPRT_DGRAM 0x00000020 /* at least one dgram-only xprt listener is used */
|
#define BC_O_USE_XPRT_DGRAM 0x00000020 /* at least one dgram-only xprt listener is used */
|
||||||
#define BC_O_USE_XPRT_STREAM 0x00000040 /* at least one stream-only xprt listener is used */
|
#define BC_O_USE_XPRT_STREAM 0x00000040 /* at least one stream-only xprt listener is used */
|
||||||
#define BC_O_NOLINGER 0x00000080 /* disable lingering on these listeners */
|
#define BC_O_NOLINGER 0x00000080 /* disable lingering on these listeners */
|
||||||
|
#define BC_O_NOQUICKACK 0x00000100 /* disable quick ack of immediate data (linux) */
|
||||||
|
|
||||||
|
|
||||||
/* flags used with bind_conf->ssl_options */
|
/* flags used with bind_conf->ssl_options */
|
||||||
|
@ -4290,6 +4290,12 @@ int check_config_validity()
|
|||||||
bind_conf->accept = session_accept_fd;
|
bind_conf->accept = session_accept_fd;
|
||||||
if (curproxy->options & PR_O_TCP_NOLING)
|
if (curproxy->options & PR_O_TCP_NOLING)
|
||||||
bind_conf->options |= BC_O_NOLINGER;
|
bind_conf->options |= BC_O_NOLINGER;
|
||||||
|
|
||||||
|
/* smart accept mode is automatic in HTTP mode */
|
||||||
|
if ((curproxy->options2 & PR_O2_SMARTACC) ||
|
||||||
|
((curproxy->mode == PR_MODE_HTTP || (bind_conf->options & BC_O_USE_SSL)) &&
|
||||||
|
!(curproxy->no_options2 & PR_O2_SMARTACC)))
|
||||||
|
bind_conf->options |= BC_O_NOQUICKACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust this proxy's listeners */
|
/* adjust this proxy's listeners */
|
||||||
@ -4331,12 +4337,6 @@ int check_config_validity()
|
|||||||
|
|
||||||
if (!LIST_ISEMPTY(&curproxy->tcp_req.l5_rules))
|
if (!LIST_ISEMPTY(&curproxy->tcp_req.l5_rules))
|
||||||
listener->options |= LI_O_TCP_L5_RULES;
|
listener->options |= LI_O_TCP_L5_RULES;
|
||||||
|
|
||||||
/* smart accept mode is automatic in HTTP mode */
|
|
||||||
if ((curproxy->options2 & PR_O2_SMARTACC) ||
|
|
||||||
((curproxy->mode == PR_MODE_HTTP || (listener->bind_conf->options & BC_O_USE_SSL)) &&
|
|
||||||
!(curproxy->no_options2 & PR_O2_SMARTACC)))
|
|
||||||
listener->options |= LI_O_NOQUICKACK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release unused SSL configs */
|
/* Release unused SSL configs */
|
||||||
|
@ -707,7 +707,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit)
|
|||||||
* in case we previously disabled it, otherwise we might cause
|
* in case we previously disabled it, otherwise we might cause
|
||||||
* the client to delay further data.
|
* the client to delay further data.
|
||||||
*/
|
*/
|
||||||
if ((sess->listener && (sess->listener->options & LI_O_NOQUICKACK)) && !(htx->flags & HTX_FL_EOM))
|
if ((sess->listener && (sess->listener->bind_conf->options & BC_O_NOQUICKACK)) && !(htx->flags & HTX_FL_EOM))
|
||||||
conn_set_quickack(cli_conn, 1);
|
conn_set_quickack(cli_conn, 1);
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
|
@ -717,7 +717,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(TCP_QUICKACK)
|
#if defined(TCP_QUICKACK)
|
||||||
if (listener->options & LI_O_NOQUICKACK)
|
if (listener->bind_conf->options & BC_O_NOQUICKACK)
|
||||||
setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &zero, sizeof(zero));
|
setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &zero, sizeof(zero));
|
||||||
else
|
else
|
||||||
setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one));
|
setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one));
|
||||||
|
Loading…
Reference in New Issue
Block a user