]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: tcp: fix outgoing polling based on proxy protocol
authorWilly Tarreau <w@1wt.eu>
Fri, 24 Oct 2014 10:02:24 +0000 (12:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Oct 2014 10:09:12 +0000 (12:09 +0200)
commitfb20e4668d0d3fbdcb97eacb9695659aa7ac1a54
treeb69b55690e9f8c26132f6b4dfe5dc370e4544feb
parenta83a50bd7d9389d3f799b9e3b7c7be346be3fab7
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.
src/proto_tcp.c