]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: splicing is broken since 1.5-dev12
authorWilly Tarreau <w@1wt.eu>
Sat, 6 Apr 2013 09:29:39 +0000 (11:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 6 Apr 2013 09:46:27 +0000 (11:46 +0200)
commit4fc90efed039f23d0d48cde895939d3e94410e54
tree0e69d07bdf9dad5ff1f98922eedcfcdac9eed449
parent91418063c3a552e979aec74ca248830b111d2520
BUG/MEDIUM: splicing is broken since 1.5-dev12

Commit 96199b10 reintroduced the splice() mechanism in the new connection
system. However, it failed to account for the number of transferred bytes,
allowing more bytes than scheduled to be transferred to the client. This
can cause an issue with small-chunked responses, where each packet from
the server may contain several chunks, because a single splice() call may
succeed, then try to splice() a second time as the pipe is not full, thus
consuming the next chunk size.

This patch also reverts commit baf2a5 ("OPTIM: splice: detect shutdowns...")
because it introduced a related regression. The issue is that splice() may
return less data than available also if the pipe is full, so having EPOLLRDHUP
after splice() returns less than expected is not a sufficient indication that
the input is empty.

In both cases, the issue may be detected by the presence of "SD" termination
flags in the logs, and worked around by disabling splicing (using "-dS").

This problem was reported by Sander Klein, and no backport is needed.
src/raw_sock.c