Commit
aab1a60977 ("BUG/MEDIUM: h2/htx: always fail on too large trailers")
explicitly returned an RST_STREAM on failure to decode some trailers, and
used the code H2_ERR_INTERNAL_ERROR. However there are multiple possible
causes for this failure to happen, and it turns out that it's much more
likely to be related to a protocol error than a decompression error. So
let's change this to PROTOCOL_ERROR, and count a protocol error on the
proxy and in the session.
This can be backported to all stable versions (with adjustments related
to these versions, maybe focusing on 3.2 max is reasonable).
/* Failed to decode this frame (e.g. too large request)
* but the HPACK decompressor is still synchronized.
*/
+ session_inc_http_err_ctr(h2c->conn->owner);
+ HA_ATOMIC_INC(&h2c->px_counters->strm_proto_err);
h2_sess_log_strm(h2c->conn->owner);
- h2s_error(h2s, H2_ERR_INTERNAL_ERROR);
+ h2s_error(h2s, H2_ERR_PROTOCOL_ERROR);
TRACE_USER("Stream error decoding H2 trailers", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_STRM_NEW|H2_EV_STRM_END, h2c->conn, 0, h2s_rxbuf_tail(h2s));
h2c->st0 = H2_CS_FRAME_E;
goto out;