BUG: http: disable TCP delayed ACKs when forwarding content-length data
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Mar 2012 07:29:20 +0000 (08:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 Mar 2012 07:46:34 +0000 (08:46 +0100)
commit869fc1edc2acfa8ff88de2f4e638ad48dca5d246
treedfe3cdeb36e2b4c7203e243688fe7ee6e07b257d
parent2d5cd479bc7a8c1ced70e562956e3ae99fe7eec9
BUG: http: disable TCP delayed ACKs when forwarding content-length data

Commits 5c6209 and 072930 were aimed at avoiding undesirable PUSH flags
when forwarding chunked data, but had the undesired effect of causing
data advertised by content-length to be affected by the delayed ACK too.
This can happen when the data to be forwarded are small enough to fit into
a single send() call, otherwise the BF_EXPECT_MORE flag would be removed.

Content-length data don't need the BF_EXPECT_MORE flag since the low-level
forwarder already knows it can safely rely on bf->to_forward to set the
appropriate TCP flags.

Note that the issue is only observed in requests at the moment, though the
later introduction of server-side keep-alive could trigger the issue on the
response path too.

Special thanks to Randy Shults for reporting this issue with a lot of
details helping to reproduce it.

The fix must be backported to 1.4.
src/proto_http.c