]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Remove usless code inside shutr callback
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Oct 2022 08:24:11 +0000 (10:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 17 Nov 2022 13:33:14 +0000 (14:33 +0100)
For now, at the transport-layer level, there is no shutr callback (in
xprt_ops). Thus, to ease the aborts refacotring, the code is removed from
the h1_shutr() function. The callback is not removed for now. It is only
kept to have a trace message. It may be handy for debugging sessions.

src/mux_h1.c

index eee97115c440a75a1cdd41e0b7181d43e38b8dbe..27d915c748330a916176bccedac1e2fe6699780d 100644 (file)
@@ -3425,38 +3425,7 @@ static void h1_shutr(struct stconn *sc, enum co_shr_mode mode)
                return;
        h1c = h1s->h1c;
 
-       TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
-
-       if (se_fl_test(h1s->sd, SE_FL_SHR))
-               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_shutr;
-       }
-       if (h1c->conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH)) {
-               TRACE_STATE("shutdown on connection (error|rd_sh|wr_sh)", H1_EV_STRM_SHUT, h1c->conn, h1s);
-               goto do_shutr;
-       }
-
-       if (!(h1c->flags & (H1C_F_ST_READY|H1C_F_ST_ERROR))) {
-               /* Here attached is implicit because there is SC */
-               TRACE_STATE("keep connection alive (ALIVE but not READY nor ERROR)", H1_EV_STRM_SHUT, h1c->conn, h1s);
-               goto end;
-       }
-       if (h1s->flags & H1S_F_WANT_KAL) {
-               TRACE_STATE("keep connection alive (want_kal)", H1_EV_STRM_SHUT, h1c->conn, h1s);
-               goto end;
-       }
-
-  do_shutr:
-       /* NOTE: Be sure to handle abort (cf. h2_shutr) */
-       if (se_fl_test(h1s->sd, SE_FL_SHR))
-               goto end;
-
-       if (conn_xprt_ready(h1c->conn) && h1c->conn->xprt->shutr)
-               h1c->conn->xprt->shutr(h1c->conn, h1c->conn->xprt_ctx, (mode == CO_SHR_DRAIN));
-  end:
-       TRACE_LEAVE(H1_EV_STRM_SHUT, h1c->conn, h1s);
+       TRACE_POINT(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
 }
 
 static void h1_shutw(struct stconn *sc, enum co_shw_mode mode)