From: Christopher Faulet Date: Wed, 12 Apr 2023 16:35:18 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Do nothing in sc_conn_recv() when the SC needs more room X-Git-Tag: v2.8-dev8~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95125886ee2599c9d65c49651a665734bbc5a0fd;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Do nothing in sc_conn_recv() when the SC needs more room We erroneously though that an attempt to receive data was not possible if the SC was waiting for more room in the channel buffer. A BUG_ON() was added to detect bugs. And in fact, it is possible. The regression was added in commit 341a5783b ("BUG/MEDIUM: stconn: stop to enable/disable reads from streams via si_update_rx"). This patch should fix the issue #2115. It must be backported if the commit above is backported. --- diff --git a/src/stconn.c b/src/stconn.c index b1d02d95f9..95fe9c5e46 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1194,7 +1194,7 @@ static int sc_conn_recv(struct stconn *sc) /* If another call to sc_conn_recv() failed, and we subscribed to * recv events already, give up now. */ - if (sc->wait_event.events & SUB_RETRY_RECV) + if ((sc->wait_event.events & SUB_RETRY_RECV) || sc_waiting_room(sc)) return 0; /* maybe we were called immediately after an asynchronous shutr */ @@ -1220,7 +1220,6 @@ static int sc_conn_recv(struct stconn *sc) /* prepare to detect if the mux needs more room */ sc_ep_clr(sc, SE_FL_WANT_ROOM); - BUG_ON(sc_waiting_room(sc)); if ((ic->flags & (CF_STREAMER | CF_STREAMER_FAST)) && !co_data(ic) && global.tune.idle_timer &&