BUG/MEDIUM: cache/filters: Fix loop on HTX blocks caching the response payload
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Mar 2020 15:19:50 +0000 (16:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Mar 2020 13:12:59 +0000 (14:12 +0100)
commit497c7595588371e8ac85c322825455d7c7d4e407
treeecf04b8baaf2f48e4530a8871ba3694643605c93
parent81340d7b533ac24cb791fbebede4f7bb36a9f007
BUG/MEDIUM: cache/filters: Fix loop on HTX blocks caching the response 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 cache point of view, when we loop on the HTX blocks to cache 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.
src/cache.c