From: Christopher Faulet Date: Wed, 24 May 2023 09:02:50 +0000 (+0200) Subject: MINOR: mux-h2: Set H2_SF_ES_RCVD flag when decoding the HEADERS frame X-Git-Tag: v2.8-dev13~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a60a663066b6913a6a8561a4155efc775013205;p=thirdparty%2Fhaproxy.git MINOR: mux-h2: Set H2_SF_ES_RCVD flag when decoding the HEADERS frame 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. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 61dc97281f..587b98f9e6 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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; }