]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stconn: Simplify sc_abort/sc_shutdown by merging calls to se_shutdown
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 9 Mar 2026 17:40:39 +0000 (18:40 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Mar 2026 14:10:34 +0000 (15:10 +0100)
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

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