From: Christopher Faulet Date: Mon, 9 Mar 2026 17:43:59 +0000 (+0100) Subject: DEBUG: stconn: Add a CHECK_IF() when I/O are performed on a orphan SC X-Git-Tag: v3.4-dev7~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00563233b7d4ac3425c6271ec7c7173c4ac7745f;p=thirdparty%2Fhaproxy.git DEBUG: stconn: Add a CHECK_IF() when I/O are performed on a orphan SC When no endpoint is attached to a SC, it is unexpected to have I/O (receive or send). But we honestly don't know if it happens or not. So a CHECK_IF() is added to be able to track such calls. --- diff --git a/src/stconn.c b/src/stconn.c index 8e56ac0ca..6c959d515 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -708,6 +708,8 @@ void sc_chk_rcv(struct stconn *sc) appctx_wakeup(__sc_appctx(sc)); } else { + /* In theory, it should not happen. This CHECK_IF will be used to validate it (or not...) */ + CHECK_IF(!sc_ep_test(sc, SE_FL_T_MUX|SE_FL_T_APPLET)); if (!(sc->flags & SC_FL_DONT_WAKE)) task_wakeup(sc_strm_task(sc), TASK_WOKEN_IO); } @@ -799,6 +801,9 @@ static inline void sc_chk_snd(struct stconn *sc) } } else { + /* In theory, it should not happen. This CHECK_IF will be used to validate it (or not...) */ + CHECK_IF(!sc_ep_test(sc, SE_FL_T_MUX|SE_FL_T_APPLET)); + if (unlikely(sc->state != SC_ST_EST || (sc->flags & SC_FL_SHUT_DONE))) return;