From: Amaury Denoyelle Date: Mon, 16 Nov 2026 16:16:31 +0000 (+0100) Subject: BUG/MINOR: hq-interop: ignore uni streams in HTTP/0.9 X-Git-Url: https://git.kaiwu.me/web/$%7BGITURL%7D$%7Bcid%7D?a=commitdiff_plain;h=7e661ddeeeda63e768e84eca596205cb6ae5fd97;p=haproxy.git BUG/MINOR: hq-interop: ignore uni streams in HTTP/0.9 HTTP/0.9 only relies on bidirectional streams. To ensure there is no undefined behavior, this is now enforced this in rcv_buf and attach callbacks. Along with this change, redundant checks on bidi stream types are removed in functions used in the context of these callbacks. This may be backported to stable releases if needed. --- diff --git a/src/hq_interop.c b/src/hq_interop.c index f7918771e..122348570 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -38,7 +38,7 @@ static ssize_t hq_interop_rcv_buf_req(struct qcs *qcs, struct buffer *b, int fin /* hq-interop parser does not support buffer wrapping. */ BUG_ON(b_data(b) != b_contig_data(b, 0)); - if (!b_data(b) && fin && quic_stream_is_bidi(qcs->id)) { + if (!b_data(b) && fin) { if (qcs_http_handle_standalone_fin(qcs, 0)) return -1; return 0; @@ -162,7 +162,7 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin } if (!to_copy) { - if (fin && quic_stream_is_bidi(qcs->id)) { + if (fin) { if (qcs_http_handle_standalone_fin(qcs, 0)) { htx_to_buf(htx, htx_buf); return -1; @@ -214,6 +214,10 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin /* Returns the amount of decoded bytes from or a negative error code. */ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) { + /* Ignore uni streams with HTTP/0.9 */ + if (quic_stream_is_uni(qcs->id)) + return b_data(b); + return !(qcs->qcc->flags & QC_CF_IS_BACK) ? hq_interop_rcv_buf_req(qcs, b, fin) : hq_interop_rcv_buf_res(qcs, b, fin); @@ -404,7 +408,8 @@ static size_t hq_interop_done_ff(struct qcs *qcs) static int hq_interop_attach(struct qcs *qcs, void *conn_ctx) { - qcs_wait_http_req(qcs); + if (quic_stream_is_bidi(qcs->id)) + qcs_wait_http_req(qcs); return 0; }