]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2: Set H2_SF_ES_RCVD flag when decoding the HEADERS frame
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 May 2023 09:02:50 +0000 (11:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 May 2023 14:06:11 +0000 (16:06 +0200)
The flag H2_SF_ES_RCVD is set on the H2 stream when the ES flag is found in
a frame. On HEADERS frame, it was set in function processing the frame. It
is moved in the function decoding the frame. Fundamentally, this changes
nothing. But it will be useful to have this information earlier when a
client H2 stream is created.

src/mux_h2.c

index 61dc97281f4a46cf82d3246a1002faa080bbafca..587b98f9e6e84d3a1ba86c3186f706eedca55da5 100644 (file)
@@ -2801,9 +2801,6 @@ static struct h2s *h2c_frt_handle_headers(struct h2c *h2c, struct h2s *h2s)
        h2s->body_len = body_len;
 
  done:
-       if (h2c->dff & H2_F_HEADERS_END_STREAM)
-               h2s->flags |= H2_SF_ES_RCVD;
-
        if (h2s->flags & H2_SF_ES_RCVD) {
                if (h2s->st == H2_SS_OPEN)
                        h2s->st = H2_SS_HREM;
@@ -2903,9 +2900,6 @@ static struct h2s *h2c_bck_handle_headers(struct h2c *h2c, struct h2s *h2s)
                goto fail;
        }
 
-       if (h2c->dff & H2_F_HEADERS_END_STREAM)
-               h2s->flags |= H2_SF_ES_RCVD;
-
        if (se_fl_test(h2s->sd, SE_FL_ERROR) && h2s->st < H2_SS_ERROR)
                h2s->st = H2_SS_ERROR;
        else if (h2s->flags & H2_SF_ES_RCVD) {
@@ -4961,6 +4955,7 @@ next_frame:
                }
                /* no more data are expected for this message */
                htx->flags |= HTX_FL_EOM;
+               *flags |= H2_SF_ES_RCVD;
        }
 
        if (msgf & H2_MSGF_EXT_CONNECT)
@@ -5011,6 +5006,7 @@ next_frame:
                TRACE_STATE("failed to append HTX trailers into rxbuf", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_H2S_ERR, h2c->conn);
                goto fail;
        }
+       *flags |= H2_SF_ES_RCVD;
        goto done;
 }