]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: Set known input payload length of the sedesc
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Oct 2025 16:53:19 +0000 (18:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Oct 2025 09:01:36 +0000 (11:01 +0200)
Set <kip> value when data are transfer to the upper layer, in h3_rcv_buf().
The difference between the known length of the payload before and after a
parsing loop is added to <kip> value. When a content-length is specified in
the message, the h3s <body_len> field is used. Otherwise, it is the h3s
<data_len> field.

src/h3.c

index e0a1233d52ffc8fc242ccef9409bb3f5c76a1c83..5b94ea40a9943b2f7dfefc09918850cff6057185 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1684,6 +1684,7 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
        struct h3s *h3s = qcs->ctx;
        struct h3c *h3c = h3s->h3c;
        ssize_t total = 0, ret = 0;
+       uint64_t prev_data_len = ((h3s->flags & H3_SF_HAVE_CLEN) ? h3s->body_len : h3s->data_len);
 
        TRACE_ENTER(H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
 
@@ -1892,6 +1893,8 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
         */
 
  done:
+       qcs->sd->kip += ((h3s->flags & H3_SF_HAVE_CLEN) ? h3s->body_len : h3s->data_len) - prev_data_len;
+
        TRACE_LEAVE(H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
        return total;