]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: mux-h1: also release the embryonic stream when the error is empty
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 14:05:00 +0000 (16:05 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 12 Oct 2026 13:46:03 +0000 (15:46 +0200)
When an error (400, 408, 500, 501) must be returned by the H1 multiplexer
and the proxy's error message is mapped on /dev/null or an empty file,
h1_send_error() exits without testing for embryonic H1 stream to destroy
it. So the H1 stream remains attached, preventing the H1 connection to be
closed as expected. The H1 connection is only released when the client
timeout expires.

Let's place the label before the embryonic stream destruction, so that it
is also performed for empty errors.

This was introduced by commit 0d4271cda ("BUG/MEDIUM: mux-h1: Properly
handle empty message when an error is triggered") in 3.1-dev7, which was
tagged for backport as far as 2.8. This must be backported where it was.

src/mux_h1.c

index 6f9ac7eedff67e4eaffb949b5551e112c7b950fb..0538088dd4682503a0a9de4c2323ef7525bdecc2 100644 (file)
@@ -3854,13 +3854,13 @@ static int h1_send_error(struct h1c *h1c)
                }
        }
 
+  out_abort:
        if (h1c->state == H1_CS_EMBRYONIC) {
                BUG_ON(h1c->h1s == NULL || h1s_sc(h1c->h1s) != NULL);
                TRACE_DEVEL("Abort embryonic H1S", H1_EV_H1C_ERR, h1c->conn, h1c->h1s);
                h1s_destroy(h1c->h1s);
        }
 
-  out_abort:
        h1c->flags = (h1c->flags & ~(H1C_F_WAIT_NEXT_REQ|H1C_F_ABRT_PENDING)) | H1C_F_ABRTED;
        h1_close(h1c);
   out: