BUG/MEDIUM: filters: Fix data filtering when data are modified
authorChristopher Faulet <christopher.faulet@capflam.org>
Tue, 21 Jun 2016 08:44:32 +0000 (10:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Jun 2016 16:53:08 +0000 (18:53 +0200)
commit55048a498af12eb6ffffb22ac62fd5df3d395468
treecaf5b67c237a69c7908b0f86fdb597ceb8695e1c
parent78f8dcb7f07903e22c5452295fe3cf8dd7ae0ea6
BUG/MEDIUM: filters: Fix data filtering when data are modified

Filters can alter data during the parsing, i.e when http_data or tcp_data
callbacks are called. For now, the update must be done by hand. So we must
handle changes in the channel buffers, especially on the number of input bytes
pending (buf->i).
In addition, a filter can choose to switch channel buffers to do its
updates. So, during data filtering, we must always use the right buffer and not
use variable to reference them.

Without this patch, filters cannot safely alter data during the data parsing.
src/filters.c