]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: filters: Adapt filters API to allow again TCP filtering on HTX streams
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 12 Nov 2019 10:13:01 +0000 (11:13 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Nov 2019 12:43:08 +0000 (13:43 +0100)
commitb2e58492b141f1e2f6d9db4c50b8dd0e5db63ee9
tree44d70db09658aa0d13223da9e836f991e8b275a6
parentbb9a7e04bd806cd78baf62eea0a84e1d8cd70573
MEDIUM: filters: Adapt filters API to allow again TCP filtering on HTX streams

This change make the payload filtering uniform between TCP and HTTP
filters. Now, in TCP, like in HTTP, there is only one callback responsible to
forward data. Thus, old callbacks, tcp_data() and tcp_forward_data(), are
replaced by a single callback function, tcp_payload(). This new callback gets
the offset in the payload to (re)start the filtering and the maximum amount of
data it can forward. It is the filter's responsibility to be compatible with HTX
streams. If not, it must not set the flag FLT_CFG_FL_HTX.

Because of this change, nxt and fwd offsets are no longer needed. Thus they are
removed from the filter structure with their update functions,
flt_change_next_size() and flt_change_forward_size(). Moreover, the trace filter
has been updated accordingly.

This patch breaks the compatibility with the old API. Thus it should probably
not be backported. But, AFAIK, there is no TCP filter, thus the breakage is very
limited.
include/proto/filters.h
include/types/filters.h
src/filters.c
src/flt_trace.c