From c6e4584d2b95c000a9e7247f0389c4496587a573 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 9 Sep 2025 15:30:59 +0200 Subject: [PATCH] BUG/MEDIUM: mux-h2; Don't block reveives in H2_CS_ERROR and H2_CS_ERROR2 states The H2 connection is switched to ERR when a GOAWAY must be sent and in ERR2 when it is sent. In these states, no more data can be emitted by the mux. But there is no reason to not try to process incoming data or to not try to receive data. It is espcially important to be able to get the shutdown from the TCP connection when a SSL connection was previously detected. Otherwise, it is possible to block a H2 connection until its timeout expiration to be able to close it. This patch should be backported to 3.2. But is is probably a good idea to not backport it on older versions, except if a bug is reported in this area. --- src/mux_h2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mux_h2.c b/src/mux_h2.c index b3b9d1757..96f6d884a 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1012,7 +1012,7 @@ h2c_is_dead(const struct h2c *h2c) */ static inline int h2_recv_allowed(const struct h2c *h2c) { - if ((h2c->flags & (H2_CF_RCVD_SHUT|H2_CF_ERROR)) || h2c->st0 >= H2_CS_ERROR) + if (h2c->flags & (H2_CF_RCVD_SHUT|H2_CF_ERROR)) return 0; if ((h2c->wait_event.events & SUB_RETRY_RECV))