From 2bf2f68cd833659e75a90b366520407c0839de08 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 18 Sep 2025 08:29:05 +0200 Subject: [PATCH] MINOR: mux-h1: Set known input payload length during demux Set value during the message parsing. The difference between the body length before and after a parsing loop is added. The patch relies on the previous one ("MINOR: h1-htx: Increment body len when parsing a payload with no xfer length"). --- src/mux_h1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mux_h1.c b/src/mux_h1.c index c3c512d89..df248a460 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2128,11 +2128,13 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count size_t data; size_t ret = 0; size_t total = 0; + uint64_t prev_body_len; htx = htx_from_buf(buf); TRACE_ENTER(H1_EV_RX_DATA, h1c->conn, h1s, htx, (size_t[]){count}); h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res); + prev_body_len = h1m->body_len; data = htx->data; if (h1s->flags & H1S_F_DEMUX_ERROR) @@ -2257,6 +2259,7 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count } b_del(&h1c->ibuf, total); + h1s->sd->kip += (h1m->body_len - prev_body_len); TRACE_DEVEL("incoming data parsed", H1_EV_RX_DATA, h1c->conn, h1s, htx, (size_t[]){ret});