]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-fcgi: Set known input payload length during demux
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 18 Sep 2025 06:32:23 +0000 (08:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Oct 2025 09:01:36 +0000 (11:01 +0200)
Set <kip> value during the response 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_fcgi.c

index eadbdfc607dfb80ed499d5c1c1fc875eba1bec73..bbec51f3a7f21f44b77138ca99585b0d6ef003f9 100644 (file)
@@ -3542,7 +3542,9 @@ static size_t fcgi_strm_parse_response(struct fcgi_strm *fstrm, struct buffer *b
        struct htx *htx;
        struct h1m *h1m = &fstrm->h1m;
        size_t ret, data, total = 0;
+       uint64_t prev_body_len;
 
+       prev_body_len = h1m->body_len;
        htx = htx_from_buf(buf);
        TRACE_ENTER(FCGI_EV_RSP_DATA, fconn->conn, fstrm, htx, (size_t[]){count});
 
@@ -3626,6 +3628,7 @@ static size_t fcgi_strm_parse_response(struct fcgi_strm *fstrm, struct buffer *b
        }
 
        b_del(&fstrm->rxbuf, total);
+       fstrm->sd->kip += (h1m->body_len - prev_body_len);
 
   end:
        htx_to_buf(htx, buf);