]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: stconn: Add a CHECK_IF() when I/O are performed on a orphan SC
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 9 Mar 2026 17:43:59 +0000 (18:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Mar 2026 14:10:34 +0000 (15:10 +0100)
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.

src/stconn.c

index 8e56ac0ca86186ff6462a50cdd46298f23b6c548..6c959d51503a0348e073fc9f8f042e6c196183f2 100644 (file)
@@ -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;