From 73d6ffe832e1f74bc55b68fed2f6ccb86a929f5e Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Mon, 16 May 2022 13:54:31 +0200 Subject: [PATCH] MINOR: h3: flag demux as full on HTX full 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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/h3.c b/src/h3.c index 299ba5db0..530713493 100644 --- 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;