From: Christopher Faulet Date: Tue, 9 Jun 2026 08:44:59 +0000 (+0200) Subject: DEBUG: stconn: Add a BUG_ON on shut flags when the endpoint is shut X-Git-Tag: v3.5-dev1~41 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/NGINX-js-1660x332.png%20%22NGINX%20JavaScript%20Banner%22?a=commitdiff_plain;h=c64e242b1ca383c441022a9138830ad106848527;p=haproxy.git DEBUG: stconn: Add a BUG_ON on shut flags when the endpoint is shut Whne the endpoint is shut (an applet or a mux), at least one of the SHW flags must be set (SE_SHW_SILENT or SE_SHW_NORMAL). It is mandatory for muxes to perform the shutdown. Otherwise, the shutdown could be ignored. So let's add a BUG_ON() on it to be sure this never happen. --- diff --git a/src/stconn.c b/src/stconn.c index c2f96a198..3015ebbaa 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -91,6 +91,9 @@ void se_shutdown(struct sedesc *sedesc, enum se_shut_mode mode) struct se_abort_info *reason = NULL; unsigned int flags = 0; + /* Should never happen, placed here to be sure we forgot nothing */ + BUG_ON(!(mode & (SE_SHW_SILENT|SE_SHW_NORMAL))); + if ((mode & (SE_SHW_SILENT|SE_SHW_NORMAL)) && !se_fl_test(sedesc, SE_FL_SHW)) { se_report_term_evt(sedesc, se_tevt_type_shutw); flags |= (mode & SE_SHW_NORMAL) ? SE_FL_SHWN : SE_FL_SHWS;