]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mux-h1/mux-pt: Remove useless test on SE_FL_SHR/SE_FL_SHW flags
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Mar 2023 07:34:25 +0000 (09:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:57:05 +0000 (08:57 +0200)
It is already performed by the called, sc_conn_shutr() and
sc_conn_shutw(). So there is no reason to still test these flags in the PT
and H1 muxes.

src/mux_h1.c
src/mux_pt.c

index f6d385b28235ecb6b314f7f4cee473010cbe9885..1292661fa63fd70ab151eadda415040263e2aa7e 100644 (file)
@@ -3550,8 +3550,6 @@ static void h1_shutw(struct stconn *sc, enum co_shw_mode mode)
 
        TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
 
-       if (se_fl_test(h1s->sd, SE_FL_SHW))
-               goto end;
        if (se_fl_test(h1s->sd, SE_FL_KILL_CONN)) {
                TRACE_STATE("stream wants to kill the connection", H1_EV_STRM_SHUT, h1c->conn, h1s);
                goto do_shutw;
index f7a72928990cbbe94429b28707cec14cd1de50f8..6f83ae4eec010df1c542a65d8aba615f3e8b4090 100644 (file)
@@ -466,8 +466,6 @@ static void mux_pt_shutr(struct stconn *sc, enum co_shr_mode mode)
 
        TRACE_ENTER(PT_EV_STRM_SHUT, conn, sc);
 
-       if (se_fl_test(ctx->sd, SE_FL_SHR))
-               return;
        se_fl_clr(ctx->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
        if (conn_xprt_ready(conn) && conn->xprt->shutr)
                conn->xprt->shutr(conn, conn->xprt_ctx,
@@ -487,8 +485,6 @@ static void mux_pt_shutw(struct stconn *sc, enum co_shw_mode mode)
 
        TRACE_ENTER(PT_EV_STRM_SHUT, conn, sc);
 
-       if (se_fl_test(ctx->sd, SE_FL_SHW))
-               return;
        if (conn_xprt_ready(conn) && conn->xprt->shutw)
                conn->xprt->shutw(conn, conn->xprt_ctx,
                    (mode == CO_SHW_NORMAL));