BUG/MINOR: filters: Use filter offset to decude the amount of forwarded data
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 24 Feb 2020 15:20:09 +0000 (16:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Mar 2020 14:52:57 +0000 (16:52 +0200)
commit38c5bcf3eca7b47a5ef7ec87a9406ae441936762
tree5e351c79d454afbc4adf7f781dd7cdd2b36ced25
parent68c0ec0fdd2d4e73dd93b6cf427783fb2d25fbf2
BUG/MINOR: filters: Use filter offset to decude the amount of forwarded data

When the tcp or http payload is filtered, it is important to use the filter
offset to decude the amount of forwarded data because this offset may change
during the call to the callback function. So we should not rely on a local
variable defined before this call.

For now, existing HAproxy filters don't change this offset, so this bug may only
affect external filters.

This patch must be forwarded as far as 1.9.

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