]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: h3: close connection on response start-line alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 Nov 2026 14:31:14 +0000 (15:31 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 Nov 2026 16:31:36 +0000 (17:31 +0100)
On QUIC backend side, correct the error handling when HTX start-line
cannot be allocated during HTTP/3 response parsing.

Previously, a stream error would be reported with H3_MESSAGE_ERROR. Now,
h3_resp_headers_to_htx() only returns a default negative value without
any explicit error code. This results in a connection level error using
H3_INTERNAL_ERROR, generated at the end of h3_rcv_buf().

This pattern is already used on request parsing. It is necessary to
close the connection asap on memory exhaustion while differentiating
between a peer protocol violation and an haproxy internal error.

This must be backported up to 3.3.

src/h3.c

index 0040b35799fcc70a254f111c23a83e5edcebf2e4..278bafccdb8357504f9d1f3e24374185b62ad47e 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1426,7 +1426,6 @@ static ssize_t h3_resp_headers_to_htx(struct qcs *qcs, const struct buffer *buf,
        sl = htx_add_stline(htx, HTX_BLK_RES_SL, flags, ist("HTTP/3.0"), status, ist(""));
        if (!sl) {
                TRACE_ERROR("cannot allocate HTX start-line", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
-               h3s->err = H3_ERR_MESSAGE_ERROR;
                len = -1;
                goto out;
        }