]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: make sure to always report pending errors to the stream
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Feb 2026 23:18:44 +0000 (00:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Feb 2026 23:30:42 +0000 (00:30 +0100)
Some stream parsing errors that do not affect the connection result in
the parsed block not being transferred from the rx buffer to the channel
and not being reported upstream in rcv_buf(), causing the stconn to time
out. Let's detect this condition, and propagate term flags anyway since
no more progress will be made otherwise.

This should be backported at least till 3.2, probably even 2.8.

src/mux_h2.c

index b3a984b27ebbf38baf6aac545c3ccef20c951e3f..c6e8c993e2ba2eac60c58e69e01909fd8e1525e5 100644 (file)
@@ -7884,7 +7884,13 @@ static size_t h2_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, in
 
        /* tell the stream layer whether there are data left or not */
        if (h2s_rxbuf_cnt(h2s)) {
+               /* Note that parsing errors can also arrive here, we may need
+                * to propagate errors upstream otherwise no new activity will
+                * unblock them.
+                */
                se_fl_set(h2s->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
+               if (h2s_htx && h2s_htx->flags & HTX_FL_PARSING_ERROR)
+                       h2s_propagate_term_flags(h2c, h2s);
                BUG_ON_HOT(!buf->data);
        }
        else {