From: Amaury Denoyelle Date: Mon, 16 May 2022 11:54:31 +0000 (+0200) Subject: MINOR: h3: flag demux as full on HTX full X-Git-Tag: v2.6-dev11~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73d6ffe832e1f74bc55b68fed2f6ccb86a929f5e;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/h3.c b/src/h3.c index 299ba5db08..5307134936 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;