]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hq-interop: support full demux buf on large response
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 22 Jun 2026 12:35:04 +0000 (14:35 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 22 Jun 2026 12:38:17 +0000 (14:38 +0200)
When dealing with large responses, QUIC MUX demux buffer may be full. In
this case, QC_SF_DEM_FULL flag must be set to pause transcoding. This
patch implements it for HTTP/0.9 response transcoding, similarly to what
HTTP/3 already provides. This is a backend side fix.

This should be backported up to 3.3.

src/hq_interop.c

index 14fd7f2234e6d9c4c1feed5855781bdb116053b6..f1b366e502ca14cfa5f8c977a41fc6a39d41d60d 100644 (file)
@@ -147,18 +147,27 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin
                BUG_ON(b_head(b) + to_copy > b_wrap(b)); /* TODO */
 
                htx_space = htx_free_data_space(htx);
+               if (!htx_space) {
+                       qcs->flags |= QC_SF_DEM_FULL;
+                       goto out;
+               }
+
                if (to_copy > htx_space) {
                        to_copy = htx_space;
                        fin = 0;
                }
 
                htx_sent = htx_add_data(htx, ist2(b_head(b), to_copy));
-               BUG_ON(htx_sent < to_copy); /* TODO */
+               if (htx_sent < to_copy) {
+                       qcs->flags |= QC_SF_DEM_FULL;
+                       goto out;
+               }
 
                if (fin && to_copy == htx_sent)
                        htx->flags |= HTX_FL_EOM;
        }
 
+ out:
        htx_to_buf(htx, htx_buf);
        return htx_sent;
 }