From 2a058151a873bcc9554ebc53e9cb44da38d9f8fd Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 23 Oct 2026 11:22:48 +0200 Subject: [PATCH] BUG/MINOR: h3: do not wait after Tx realloc failure The following commit implements for QUIC transcoders a realloc operation when a smallbuf is not sufficient to encode headers. This is available via qcc_realloc_stream_txbuf() function. 0d6112b40b20f9eea0cf38dc304bc1155b673588 MINOR: mux-quic: retry after small buf alloc failure However, an alloc failure of this function was considered as a transient error, with 0 returned in this case. Fix this so that it is now a fatal error which will trigger the connection closure, which is the correct handling for memory allocation issues in QUIC MUX layer. This must be backported up to 3.2. Note that the chunk relative to h3_req_headers_send() is specific for QUIC backend usage and must only be picked on 3.3 and above. --- src/h3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/h3.c b/src/h3.c index 9516a1579..7510a0a04 100644 --- a/src/h3.c +++ b/src/h3.c @@ -2499,7 +2499,8 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx, char *fin) res = smallbuf ? qcc_get_stream_txbuf(qcs, &err, 1) : qcc_realloc_stream_txbuf(qcs); if (!res) { - if (err) { + /* detect alloc failure for qcc_get_stream_txbuf() / qcc_realloc_stream_txbuf() */ + if (!smallbuf || err) { TRACE_ERROR("cannot allocate Tx buffer", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs); goto err; } @@ -2775,7 +2776,8 @@ static int h3_resp_headers_send(struct qcs *qcs, struct htx *htx, char *fin) res = smallbuf ? qcc_get_stream_txbuf(qcs, &err, 1) : qcc_realloc_stream_txbuf(qcs); if (!res) { - if (err) { + /* detect alloc failure for qcc_get_stream_txbuf() / qcc_realloc_stream_txbuf() */ + if (!smallbuf || err) { TRACE_ERROR("cannot allocate Tx buffer", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs); goto err; } -- 2.47.3