]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: flag demux as full on HTX full
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 May 2022 11:54:31 +0000 (13:54 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 May 2022 13:38:01 +0000 (15:38 +0200)
Flag QCS if HTX buffer is full on demux. This will block all future
operations on QCS demux and should limit unnecessary decode_qcs() calls.
The flag is cleared on rcv_buf operation called by conn-stream.

src/h3.c

index 299ba5db081bbe5dbb8192d992979eeace63dc50..5307134936a7cbf8ca91578c8028a3f03aec2e0a 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -235,13 +235,21 @@ static int h3_data_to_htx(struct qcs *qcs, struct ncbuf *buf, uint64_t len,
        if (head + len > ncb_wrap(buf)) {
                size_t contig = ncb_wrap(buf) - head;
                htx_sent = htx_add_data(htx, ist2(ncb_head(buf), contig));
-               head = ncb_orig(buf);
+               if (htx_sent < contig) {
+                       qcs->flags |= QC_SF_DEM_FULL;
+                       goto out;
+               }
+
                len -= contig;
+               head = ncb_orig(buf);
                goto retry;
        }
 
        htx_sent += htx_add_data(htx, ist2(head, len));
-       BUG_ON(htx_sent < len);
+       if (htx_sent < len) {
+               qcs->flags |= QC_SF_DEM_FULL;
+               goto out;
+       }
 
        if (fin && len == htx_sent)
                htx->flags |= HTX_FL_EOM;