mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-10-27 22:51:02 +01:00
MINOR: mux-h1: Set known input payload length during demux
Set <kip> 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").
This commit is contained in:
parent
c9bc18c0bf
commit
2bf2f68cd8
@ -2128,11 +2128,13 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count
|
|||||||
size_t data;
|
size_t data;
|
||||||
size_t ret = 0;
|
size_t ret = 0;
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
|
uint64_t prev_body_len;
|
||||||
|
|
||||||
htx = htx_from_buf(buf);
|
htx = htx_from_buf(buf);
|
||||||
TRACE_ENTER(H1_EV_RX_DATA, h1c->conn, h1s, htx, (size_t[]){count});
|
TRACE_ENTER(H1_EV_RX_DATA, h1c->conn, h1s, htx, (size_t[]){count});
|
||||||
|
|
||||||
h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
|
h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
|
||||||
|
prev_body_len = h1m->body_len;
|
||||||
data = htx->data;
|
data = htx->data;
|
||||||
|
|
||||||
if (h1s->flags & H1S_F_DEMUX_ERROR)
|
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);
|
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});
|
TRACE_DEVEL("incoming data parsed", H1_EV_RX_DATA, h1c->conn, h1s, htx, (size_t[]){ret});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user