MEDIUM: h2: remove the H2_SS_RESET intermediate state
This one was created to maintain the knowledge that a stream was closed
after having sent an RST_STREAM frame but that's not needed anymore and
it confuses certain conditions on the error processing path. It's time
to get rid of it.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 789f8ea..7e80dca 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -121,7 +121,6 @@
H2_SS_HREM, // half-closed(remote)
H2_SS_HLOC, // half-closed(local)
H2_SS_ERROR, // an error needs to be sent using RST_STREAM
- H2_SS_RESET, // closed after sending RST_STREAM
H2_SS_CLOSED, // closed
H2_SS_ENTRIES // must be last
} __attribute__((packed));
@@ -837,7 +836,7 @@
/* len: 4, type: 3, flags: none */
memcpy(str, "\x00\x00\x04\x03\x00", 5);
write_n32(str + 5, h2c->dsi);
- write_n32(str + 9, (h2s->st > H2_SS_IDLE && h2s->st < H2_SS_RESET) ?
+ write_n32(str + 9, (h2s->st > H2_SS_IDLE && h2s->st < H2_SS_CLOSED) ?
h2s->errcode : H2_ERR_STREAM_CLOSED);
ret = bo_istput(res, ist2(str, 13));
if (unlikely(ret <= 0)) {
@@ -873,8 +872,7 @@
char str[9];
int ret;
- if (h2s->st == H2_SS_HLOC || h2s->st == H2_SS_ERROR ||
- h2s->st == H2_SS_RESET || h2s->st == H2_SS_CLOSED)
+ if (h2s->st == H2_SS_HLOC || h2s->st == H2_SS_ERROR || h2s->st == H2_SS_CLOSED)
return 1;
if (h2c_mux_busy(h2c, h2s)) {
@@ -1443,7 +1441,7 @@
goto conn_err;
}
- if (h2s->st >= H2_SS_RESET) {
+ if (h2s->st >= H2_SS_ERROR) {
/* stream error : send RST_STREAM */
h2c->st0 = H2_CS_FRAME_A;
}
@@ -1521,7 +1519,7 @@
goto strm_err;
}
- if (h2s->st >= H2_SS_RESET) {
+ if (h2s->st >= H2_SS_ERROR) {
/* stream error : send RST_STREAM */
h2c->st0 = H2_CS_FRAME_A;
}
@@ -2232,8 +2230,7 @@
if (!mode)
return;
- if (h2s->st == H2_SS_HLOC || h2s->st == H2_SS_ERROR ||
- h2s->st == H2_SS_RESET || h2s->st == H2_SS_CLOSED)
+ if (h2s->st == H2_SS_HLOC || h2s->st == H2_SS_ERROR || h2s->st == H2_SS_CLOSED)
return;
if (h2c_send_rst_stream(h2s->h2c, h2s) <= 0)
@@ -2249,8 +2246,7 @@
{
struct h2s *h2s = cs->ctx;
- if (h2s->st == H2_SS_HLOC || h2s->st == H2_SS_ERROR ||
- h2s->st == H2_SS_RESET || h2s->st == H2_SS_CLOSED)
+ if (h2s->st == H2_SS_HLOC || h2s->st == H2_SS_ERROR || h2s->st == H2_SS_CLOSED)
return;
if (h2s->flags & H2_SF_HEADERS_SENT) {