mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-21 13:16:57 +00:00
MINOR: h2: centralize the check for the half-closed(remote) streams
RFC7540#5.1 is pretty clear : "any frame other than WINDOW_UPDATE, PRIORITY, or RST_STREAM in this state MUST be treated as a connection error of type STREAM_CLOSED". Instead of dealing with this for each and every frame type, let's do it once for all in the main demux loop.
This commit is contained in:
parent
f65b80dd47
commit
f182a9a8b4
10
src/mux_h2.c
10
src/mux_h2.c
@ -1613,6 +1613,15 @@ static void h2_process_demux(struct h2c *h2c)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (h2s->st == H2_SS_HREM && h2c->dft != H2_FT_WINDOW_UPDATE &&
|
||||||
|
h2c->dft != H2_FT_RST_STREAM && h2c->dft != H2_FT_PRIORITY) {
|
||||||
|
/* RFC7540#5.1: any frame other than WU/PRIO/RST in
|
||||||
|
* this state MUST be treated as a stream error
|
||||||
|
*/
|
||||||
|
h2s_error(h2s, H2_ERR_STREAM_CLOSED);
|
||||||
|
goto strm_err;
|
||||||
|
}
|
||||||
|
|
||||||
switch (h2c->dft) {
|
switch (h2c->dft) {
|
||||||
case H2_FT_SETTINGS:
|
case H2_FT_SETTINGS:
|
||||||
if (h2c->st0 == H2_CS_FRAME_P)
|
if (h2c->st0 == H2_CS_FRAME_P)
|
||||||
@ -1679,6 +1688,7 @@ static void h2_process_demux(struct h2c *h2c)
|
|||||||
ret = h2c->dfl == 0;
|
ret = h2c->dfl == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strm_err:
|
||||||
/* RST are sent similarly to frame acks */
|
/* RST are sent similarly to frame acks */
|
||||||
if (h2s->st == H2_SS_ERROR) {
|
if (h2s->st == H2_SS_ERROR) {
|
||||||
if (h2c->st0 == H2_CS_FRAME_P)
|
if (h2c->st0 == H2_CS_FRAME_P)
|
||||||
|
Loading…
Reference in New Issue
Block a user