From: Christopher Faulet Date: Mon, 9 Mar 2026 17:40:39 +0000 (+0100) Subject: MINOR: stconn: Simplify sc_abort/sc_shutdown by merging calls to se_shutdown X-Git-Tag: v3.4-dev7~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2b0d1a8be37368e2caeb75b796b9f48bf831e6d;p=thirdparty%2Fhaproxy.git MINOR: stconn: Simplify sc_abort/sc_shutdown by merging calls to se_shutdown Calls to se_shutdown were no the same between applets and mux endpoints. Only the SHUTW flag was not the same. However, on the multiplexers are sensitive to the true SHUTW flag. The applets handle all of them the same way. So calls to se_shutdown() from sc_abort() and sc_shutdown() can be merged to always use the multiplexer version. --- diff --git a/src/stconn.c b/src/stconn.c index edbd7f064..8e56ac0ca 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -581,10 +581,8 @@ void sc_abort(struct stconn *sc) return; if (sc->flags & SC_FL_SHUT_DONE) { - if (sc_ep_test(sc, SE_FL_T_MUX)) + if (sc_ep_test(sc, SE_FL_T_MUX|SE_FL_T_APPLET)) se_shutdown(sc->sedesc, SE_SHR_RESET|SE_SHW_SILENT); - else if (sc_ep_test(sc, SE_FL_T_APPLET)) - se_shutdown(sc->sedesc, SE_SHR_RESET|SE_SHW_NORMAL); sc->state = SC_ST_DIS; if (sc->flags & SC_FL_ISBACK) @@ -639,10 +637,8 @@ void sc_shutdown(struct stconn *sc) return; } - if (sc_ep_test(sc, SE_FL_T_MUX)) + if (sc_ep_test(sc, SE_FL_T_MUX|SE_FL_T_APPLET)) se_shutdown(sc->sedesc, SE_SHR_RESET|((sc->flags & SC_FL_NOLINGER) ? SE_SHW_SILENT : SE_SHW_NORMAL)); - else if (sc_ep_test(sc, SE_FL_T_APPLET)) - se_shutdown(sc->sedesc, SE_SHR_RESET|SE_SHW_NORMAL); sc->state = SC_ST_DIS; break;