]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stream-int: Rely only on SI_FL_WAIT_ROOM to stop data receipt
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 Oct 2018 11:54:13 +0000 (13:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2018 09:18:37 +0000 (10:18 +0100)
commitb3e0de46ce54de066d329253625d734b01134aa0
tree5a19b05de2cf8ab793331da7f93ab8d3571e838a
parentd0d40ebf5e71e527c09826b5a9d49ba8462c1b52
MEDIUM: stream-int: Rely only on SI_FL_WAIT_ROOM to stop data receipt

This flag is set on the stream interface when we should wait for more space in
the channel's buffer to store more incoming data. This means we should wait some
outgoing data are sent before retrying to receive more data.

But in stream interface functions, at many places, instead of checking this
flag, we use the function channel_may_recv to know if we can (re)start
reading. This currently works but it is not really consistent. And, it works
because only raw data are stored in buffers. But it will be a problem when we
start to store structured data in buffers.

So to avoid any problems with futur implementations, we now rely only on
SI_FL_WAIT_ROOM. The function channel_may_recv can still be called, but only
when we are sure to handle raw data (for instance in functions ci_put*). To do
so, among other things, we must be sure to unset SI_FL_WAIT_ROOM and offer an
opportunity to call chk_rcv() on a stream interface when some data are sent
on the other end, which is now granted by the previous patch series.
src/stream_interface.c