From: Christopher Faulet Date: Fri, 17 Nov 2023 10:59:33 +0000 (+0100) Subject: BUG/MINOR: stconn: Use HTX-aware channel's functions to get info on buffer X-Git-Tag: v2.9-dev10~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab5ecaa2ea57aae22b22e98c7c57de5d67a3891a;p=thirdparty%2Fhaproxy.git BUG/MINOR: stconn: Use HTX-aware channel's functions to get info on buffer Some channel function are used to check if the channel's buffer is full, not empty or if there are input data. However, functions used are not HTX-aware. So it is not accurate and may prevent some actions to be performed (However, not sure there are really issues). Because HTX-aware versions now exist, use them instead. This patch may be backported as far as 2.2. It relies on * "MINOR: channel: Add functions to get info on buffers and deal with HTX streams" * "MINOR: htx: Use a macro for overhead induced by HTX" --- diff --git a/src/stconn.c b/src/stconn.c index e7ed6a7ae1..d408e3cd20 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1091,7 +1091,7 @@ static 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) && - (!(sc->flags & SC_FL_SND_EXP_MORE) || c_full(ic) || ci_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; last_len = co_data(ic) + sc_ep_ff_data(sco); @@ -1275,7 +1275,7 @@ static int sc_conn_recv(struct stconn *sc) */ if ((global.tune.options & GTUNE_USE_ZERO_COPY_FWD) && sc_ep_test(sc, SE_FL_MAY_FASTFWD) && ic->to_forward) { - if (c_data(ic)) { + if (channel_data(ic)) { /* We're embarrassed, there are already data pending in * the buffer and we don't want to have them at two * locations at a time. Let's indicate we need some