BUG/MEDIUM: compression/filters: Fix loop on HTX blocks compressing the payload
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Mar 2020 15:20:05 +0000 (16:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Mar 2020 14:52:57 +0000 (16:52 +0200)
commita00ee127e970e3818279e5cbe2530896b66f2512
tree11e7a38c436f7063fb14992d682d27306638a0e3
parentcf004eb5118ed4075537457dd993e578532df7ec
BUG/MEDIUM: compression/filters: Fix loop on HTX blocks compressing the payload

During the payload filtering, the offset is relative to the head of the HTX
message and not its first index. This index is the position of the first block
to (re)start the HTTP analysis. It must be used during HTTP analysis but not
during the payload forwarding.

So, from the compression filter point of view, when we loop on the HTX blocks to
compress the response payload, we must start from the head of the HTX
message. To ease the loop, we use the function htx_find_offset().

This patch must be backported as far as 2.0. It depends on the commit "MINOR:
htx: Add a function to return a block at a specific an offset". So this one must
be backported first.

(cherry picked from commit e6a62bf79655623da0ecd7e412175bf38c99ab9d)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/flt_http_comp.c