From ae761da14671cf6063c04f803e5c66da3512f80f Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 29 Oct 2021 14:55:59 +0200 Subject: [PATCH] BUG/MEDIUM: stream-int: Block reads if channel cannot receive more data First of all, we must be careful here because this part was modified and each time, this introduced a bug. But, in si_update_rx(), we must not re-enables receives if the channel buffer cannot receive more data. Otherwise the multiplexer will be wake up for nothing. Because the stream is woken up when the multiplexer is waiting for more room to move on, this may lead to a ping-pong loop between the stream and the mux. Note that for now, it does not fix any known bug. All reported issues in this area were fixed in another way. This patch must be backported with a special care. Technically speaking, it may be backported as far as 2.0. (cherry picked from commit 69fad00ebf65ad0dedabaf10db43fb3783f7ecae) Signed-off-by: Willy Tarreau (cherry picked from commit dce066777a3072945c3b52210f503104139c2b0d) Signed-off-by: Christopher Faulet --- src/stream_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index b54162f..e37425d 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -825,7 +825,7 @@ void si_update_rx(struct stream_interface *si) else si_rx_chan_rdy(si); - if (!channel_is_empty(ic)) { + if (!channel_is_empty(ic) || !channel_may_recv(ic)) { /* stop reading, imposed by channel's policy or contents */ si_rx_room_blk(si); } -- 1.7.10.4