]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2; Don't block reveives in H2_CS_ERROR and H2_CS_ERROR2 states
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 9 Sep 2025 13:30:59 +0000 (15:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 9 Sep 2025 14:07:20 +0000 (16:07 +0200)
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

index b3b9d1757faab78cfd9b2603ba0dc0b049d9062c..96f6d884abbd0dcbc1a10999dd10863667277e51 100644 (file)
@@ -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))