BUG/MEDIUM: h2: don't switch the state to HREM before end of DATA frame
We used to switch the stream's state to HREM when seeing and ES bit on the DATA frame before actually being able to process that frame, possibly resulting in the DATA frame being processed after the stream was seen as half-closed and possibly being rejected. The state must not change before the frame is really processed. Also fixes a harmless typo in the flag name which should have DATA and not HEADERS in its name (but all values are equal). Must be backported to 1.8.
This commit is contained in:
parent
6847262211
commit
c4134ba8b0
13
src/mux_h2.c
13
src/mux_h2.c
@ -1656,12 +1656,6 @@ static int h2c_frt_handle_data(struct h2c *h2c, struct h2s *h2s)
|
||||
goto strm_err;
|
||||
}
|
||||
|
||||
/* last frame */
|
||||
if (h2c->dff & H2_F_HEADERS_END_STREAM) {
|
||||
h2s->st = H2_SS_HREM;
|
||||
h2s->flags |= H2_SF_ES_RCVD;
|
||||
}
|
||||
|
||||
/* call the upper layers to process the frame, then let the upper layer
|
||||
* notify the stream about any change.
|
||||
*/
|
||||
@ -1692,6 +1686,13 @@ static int h2c_frt_handle_data(struct h2c *h2c, struct h2s *h2s)
|
||||
if (h2c->st0 == H2_CS_FRAME_P)
|
||||
return 0;
|
||||
|
||||
|
||||
/* last frame */
|
||||
if (h2c->dff & H2_F_DATA_END_STREAM) {
|
||||
h2s->st = H2_SS_HREM;
|
||||
h2s->flags |= H2_SF_ES_RCVD;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
conn_err:
|
||||
|
Loading…
x
Reference in New Issue
Block a user