From 7ab99a302d37d3d39ee6c8094e3a0c154ce5896b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 18 Dec 2018 09:15:43 +0100 Subject: [PATCH] BUG/MEDIUM: stream-int: always clear CS_FL_WANT_ROOM before receiving Commit d94f877cd ("BUG/MINOR: mux_pt: Set CS_FL_WANT_ROOM when count is zero in rcv_buf() callback") triggered a pending issue with this flag, which is that it's cleared too late and sometimes causes some Rx transfers to stall. We need to clear it before attempting to receive otherwise we may risk to see an earlier copy of the flag. Note that it should probably be defined that this flag could be purged on each invocation of mux->rcv_buf(), which would make sense. No backport is needed. --- src/stream_interface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stream_interface.c b/src/stream_interface.c index ae9a76f744..6eb03be185 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1116,6 +1116,9 @@ int si_cs_recv(struct conn_stream *cs) return 1; // We want to make sure si_cs_wake() is called, so that process_strema is woken up, on failure } + /* prepare to detect if the mux needs more room */ + cs->flags &= ~CS_FL_WANT_ROOM; + if ((ic->flags & (CF_STREAMER | CF_STREAMER_FAST)) && !co_data(ic) && global.tune.idle_timer && (unsigned short)(now_ms - ic->last_read) >= global.tune.idle_timer) { -- 2.47.2