From: Christopher Faulet Date: Wed, 1 Jun 2022 15:35:34 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Don't wakeup applet for send if it won't consume data X-Git-Tag: v2.7-dev1~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04f03e15c31ada85a79e7977676ed558681a6b99;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Don't wakeup applet for send if it won't consume data in .chk_snd applet callback function, we must not wake up an applet if SE_FL_WONT_CONSUME flag is set. Indeed, if an applet explicitly specify it will not consume any outgoing data, it is useless to wake it up when more data are sent. Note the applet may still be woken up for another reason. In this case SE_FL_WONT_CONSUME flag will be removed. It is the applet responsibility to set it again, if necessary. This patch must be backported to 2.6 after an observation period. On earlier versions, the bug probably exists too. However, because a massive refactoring was performed in 2.6, the patch will have to be adapted and carefully reviewed/tested if it is backported.. --- diff --git a/src/stconn.c b/src/stconn.c index 28f77ecb86..5d4ed3ed47 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -981,9 +981,8 @@ static void sc_app_chk_snd_applet(struct stconn *sc) if (unlikely(sc->state != SC_ST_EST || (oc->flags & CF_SHUTW))) return; - /* we only wake the applet up if it was waiting for some data */ - - if (!sc_ep_test(sc, SE_FL_WAIT_DATA)) + /* we only wake the applet up if it was waiting for some data and is ready to consume it */ + if (!sc_ep_test(sc, SE_FL_WAIT_DATA) || sc_ep_test(sc, SE_FL_WONT_CONSUME)) return; if (!tick_isset(oc->wex))