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.
This commit is contained in:
Christopher Faulet 2023-05-24 11:02:50 +02:00
parent 78b1eb2b04
commit 1a60a66306

View 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;
}