mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-26 22:52:13 +00:00
BUG/MEDIUM: tcp: fix outgoing polling based on proxy protocol
During a tcp connection setup in tcp_connect_server(), we check if
there are pending data to start polling for writes immediately. We
also use the same test to know if we can disable the quick ack and
merge the first data packet with the connection's ACK. This last
case is also valid for the proxy protocol.
The problem lies in the way it's done, as the "data" variable is
improperly completed with the presence of the proxy protocol, resulting
in the connection being polled for data writes if the proxy protocol is
enabled. It's not a big issue per se, except that the proxy protocol
uses the fact that we're polling for data to know if it can use MSG_MORE.
This causes no problem on HTTP/HTTPS, but with banner protocols, it
introduces a 200ms delay if the server waits for the PROXY header.
This has been caused by the connection management changes introduced in
1.5-dev12, specifically commit a1a7474
("MEDIUM: proxy-proto: don't use
buffer flags in conn_si_send_proxy()"), so this fix must be backported
to 1.5.
This commit is contained in:
parent
a83a50bd7d
commit
fb20e4668d
@ -450,15 +450,12 @@ int tcp_connect_server(struct connection *conn, int data, int delack)
|
||||
}
|
||||
}
|
||||
|
||||
/* if a send_proxy is there, there are data */
|
||||
data |= conn->send_proxy_ofs;
|
||||
|
||||
#if defined(TCP_QUICKACK)
|
||||
/* disabling tcp quick ack now allows the first request to leave the
|
||||
* machine with the first ACK. We only do this if there are pending
|
||||
* data in the buffer.
|
||||
*/
|
||||
if (delack == 2 || ((delack || data) && (be->options2 & PR_O2_SMARTCON)))
|
||||
if (delack == 2 || ((delack || data || conn->send_proxy_ofs) && (be->options2 & PR_O2_SMARTCON)))
|
||||
setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &zero, sizeof(zero));
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user