]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stream-int: avoid calling rcv_buf() when splicing is still possible
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Dec 2019 17:13:04 +0000 (18:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Dec 2019 10:55:49 +0000 (11:55 +0100)
commitc640ef1a7de5d13504599f85ca3cf3c282128a05
tree7ddc92127a2f91173a68b7e70689250459a0e4fb
parent1ac5f208042ff571c9341aed0380ca52c084a261
BUG/MINOR: stream-int: avoid calling rcv_buf() when splicing is still possible

In si_cs_recv(), we can end up with a partial splice() call that will be
followed by an attempt to us rcv_buf(). Sometimes this works and places
data into the buffer, which then prevent splicing from being used, and
this causes splice() and recvfrom() calls to alternate. Better simply
refrain from calling rcv_buf() when there are data in the pipe and still
data to be forwarded. Usually this indicates that we've ate everything
available and that we still want to use splice() on subsequent calls.

This should be backported to 2.1 and 2.0.
src/stream_interface.c