From 04f03e15c31ada85a79e7977676ed558681a6b99 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 1 Jun 2022 17:35:34 +0200 Subject: [PATCH] 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.. --- src/stconn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stconn.c b/src/stconn.c index 28f77ecb8..5d4ed3ed4 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))