BUG/MEDIUM: h2: fix some wrong error codes on connections
When the assignment of the connection state was moved into h2c_error(),
3 of them were missed because they were wrong, using H2_SS_ERROR instead.
This resulted in the connection's state being set to H2_CS_ERROR2 in fact,
so the error was not properly sent.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 7e80dca..fbd042b 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -1731,7 +1731,6 @@
case H2_FT_PUSH_PROMISE:
/* not permitted here, RFC7540#5.1 */
h2c_error(h2c, H2_ERR_PROTOCOL_ERROR);
- h2c->st0 = H2_SS_ERROR;
break;
/* implement all extra frame types here */
@@ -2316,7 +2315,6 @@
if (*hdrs >= flen) {
/* RFC7540#6.2 : pad length = length of frame payload or greater */
h2c_error(h2c, H2_ERR_PROTOCOL_ERROR);
- h2c->st0 = H2_SS_ERROR;
return 0;
}
flen -= *hdrs + 1;
@@ -2430,7 +2428,6 @@
if (padlen >= flen) {
/* RFC7540#6.1 : pad length = length of frame payload or greater */
h2c_error(h2c, H2_ERR_PROTOCOL_ERROR);
- h2c->st0 = H2_SS_ERROR;
return 0;
}
flen -= padlen + 1;