]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mux-h1: always take the endp from the h1s not the cs
authorWilly Tarreau <w@1wt.eu>
Tue, 10 May 2022 08:27:08 +0000 (10:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 May 2022 12:27:57 +0000 (14:27 +0200)
At a few places the endpoint pointer was retrieved from the conn_stream
while it's safer and more long-term proof to take it from the h1s. Let's
just do that.

src/mux_h1.c

index f923f3335fe274c5a8f9aeb521d49bc5d0dfd7ab..31a8a47ae03e1eaf95e942bb377e38a5b0daa8c4 100644 (file)
@@ -3481,9 +3481,9 @@ static void h1_shutr(struct conn_stream *cs, enum co_shr_mode mode)
 
        TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
 
-       if (cs->endp->flags & CS_EP_SHR)
+       if (h1s->endp->flags & CS_EP_SHR)
                goto end;
-       if (cs->endp->flags & CS_EP_KILL_CONN) {
+       if (h1s->endp->flags & CS_EP_KILL_CONN) {
                TRACE_STATE("stream wants to kill the connection", H1_EV_STRM_SHUT, h1c->conn, h1s);
                goto do_shutr;
        }
@@ -3504,7 +3504,7 @@ static void h1_shutr(struct conn_stream *cs, enum co_shr_mode mode)
 
   do_shutr:
        /* NOTE: Be sure to handle abort (cf. h2_shutr) */
-       if (cs->endp->flags & CS_EP_SHR)
+       if (h1s->endp->flags & CS_EP_SHR)
                goto end;
 
        if (conn_xprt_ready(h1c->conn) && h1c->conn->xprt->shutr)
@@ -3524,9 +3524,9 @@ static void h1_shutw(struct conn_stream *cs, enum co_shw_mode mode)
 
        TRACE_ENTER(H1_EV_STRM_SHUT, h1c->conn, h1s, 0, (size_t[]){mode});
 
-       if (cs->endp->flags & CS_EP_SHW)
+       if (h1s->endp->flags & CS_EP_SHW)
                goto end;
-       if (cs->endp->flags & CS_EP_KILL_CONN) {
+       if (h1s->endp->flags & CS_EP_KILL_CONN) {
                TRACE_STATE("stream wants to kill the connection", H1_EV_STRM_SHUT, h1c->conn, h1s);
                goto do_shutw;
        }