mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-21 05:00:42 +00:00
BUG/MINOR: mux-h2: mark end-of-stream after processing response HEADERS, not before
When dealing with a server's H2 response, we used to set the end-of-stream flag on the conn_stream and the stream before parsing the response, which is incorrect since we can fail to process this response by lack of room, buffer or anything. The extend of this problem is still limited to a few rare cases, but with trailers it will cause a systematic failure. This fix must be backported to 1.9.
This commit is contained in:
parent
c1fc95f850
commit
45ffc0ca34
10
src/mux_h2.c
10
src/mux_h2.c
@ -1954,11 +1954,6 @@ static struct h2s *h2c_bck_handle_headers(struct h2c *h2c, struct h2s *h2s)
|
||||
if (b_data(&h2c->dbuf) < h2c->dfl && !b_full(&h2c->dbuf))
|
||||
return NULL; // incomplete frame
|
||||
|
||||
if (h2c->dff & H2_F_HEADERS_END_STREAM) {
|
||||
h2s->flags |= H2_SF_ES_RCVD;
|
||||
h2s->cs->flags |= CS_FL_REOS;
|
||||
}
|
||||
|
||||
if (!h2c_decode_headers(h2c, &h2s->rxbuf, &h2s->flags))
|
||||
return NULL;
|
||||
|
||||
@ -1970,6 +1965,11 @@ static struct h2s *h2c_bck_handle_headers(struct h2c *h2c, struct h2s *h2s)
|
||||
h2c->st0 = H2_CS_FRAME_E;
|
||||
}
|
||||
|
||||
if (h2c->dff & H2_F_HEADERS_END_STREAM) {
|
||||
h2s->flags |= H2_SF_ES_RCVD;
|
||||
h2s->cs->flags |= CS_FL_REOS;
|
||||
}
|
||||
|
||||
if (h2s->cs->flags & CS_FL_ERROR && h2s->st < H2_SS_ERROR)
|
||||
h2s->st = H2_SS_ERROR;
|
||||
else if (h2s->cs->flags & CS_FL_REOS && h2s->st == H2_SS_OPEN)
|
||||
|
Loading…
Reference in New Issue
Block a user