From 50d8c187423d6b7e9b1083e05370885f6d12e844 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 15 Apr 2024 19:09:01 +0200 Subject: [PATCH] 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. --- src/stconn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stconn.c b/src/stconn.c index acfa6cc39..7cdc9ff30 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; -- 2.47.3