From: Willy Tarreau Date: Tue, 18 Dec 2018 08:15:43 +0000 (+0100) Subject: BUG/MEDIUM: stream-int: always clear CS_FL_WANT_ROOM before receiving X-Git-Tag: v1.9.0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ab99a302d37d3d39ee6c8094e3a0c154ce5896b;p=thirdparty%2Fhaproxy.git 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. --- 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) {