]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http_fetch: fix "req.body_len" and "req.body_size" fetch methods in HTX...
authorDragan Dosen <ddosen@haproxy.com>
Thu, 14 Feb 2019 11:30:53 +0000 (12:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 14 Feb 2019 14:41:17 +0000 (15:41 +0100)
commit5a606685f1d6bb4b6bf8ea82419c0eb03982360c
tree0a395d13bcd356e1f998be16463b3dbb7392a62c
parent6cdaf2ad9a73f3b319cac409c7116ab090342049
BUG/MEDIUM: http_fetch: fix "req.body_len" and "req.body_size" fetch methods in HTX mode

When in HTX mode, in functions smp_fetch_body_len() and
smp_fetch_body_size() we were subtracting the size of each header block
from the total size htx->data to calculate the size of body, and that
could result in wrong calculated value.

To avoid this, we now loop on blocks to sum up the size of only those
that are of type HTX_BLK_DATA.

This patch must be backported to 1.9.
src/http_fetch.c