From b2b0d1a8be37368e2caeb75b796b9f48bf831e6d Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 9 Mar 2026 18:40:39 +0100 Subject: [PATCH] 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. --- src/stconn.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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;