From: Christopher Faulet Date: Mon, 15 Apr 2024 17:09:01 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Don't forward channel data if input data must be filtered X-Git-Tag: v3.0-dev8~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50d8c187423d6b7e9b1083e05370885f6d12e844;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Don't forward channel data if input data must be filtered Once data are received and placed in a channel buffer, if it is possible, outgoing data are immediately forwarded. But we must take care to not do so if there is also pending input data and a filter registered on the channel. It is especially important for HTX streams because the HTX may be altered, especially the extra field. And it is indeed an issue with the HTTP compression filter and the H1 multiplexer. The wrong chunk size may be announced leading to an internal error. This patch should fix the issue #2530. It must be backported to all stable versions. --- diff --git a/src/stconn.c b/src/stconn.c index acfa6cc395..7cdc9ff304 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1102,6 +1103,7 @@ void sc_notify(struct stconn *sc) */ if (sc_ep_have_ff_data(sc_opposite(sc)) || (co_data(ic) && sc_ep_test(sco, SE_FL_WAIT_DATA) && + (!HAS_DATA_FILTERS(__sc_strm(sc), ic) || channel_input_data(ic) == 0) && (!(sc->flags & SC_FL_SND_EXP_MORE) || channel_full(ic, co_data(ic)) || channel_input_data(ic) == 0))) { int new_len, last_len;