MAJOR: filters: Require explicit registration to filter HTTP body and TCP data
authorChristopher Faulet <cfaulet@qualys.com>
Fri, 4 Dec 2015 08:25:05 +0000 (09:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Feb 2016 13:53:15 +0000 (14:53 +0100)
commitda02e17d428103b73b429e6b0f34d96f39344444
tree6fbfc84e4069f3625c527469e466edebc66dc4bd
parentfcf035cb5a89d6be8844261dcf82722650191711
MAJOR: filters: Require explicit registration to filter HTTP body and TCP data

Before, functions to filter HTTP body (and TCP data) were called from the moment
at least one filter was attached to the stream. If no filter is interested by
these data, this uselessly slows data parsing.
A good example is the HTTP compression filter. Depending of request and response
headers, the response compression can be enabled or not. So it could be really
nice to call it only when enabled.

So, now, to filter HTTP/TCP data, a filter must use the function
register_data_filter. For TCP streams, this function can be called only
once. But for HTTP streams, when needed, it must be called for each HTTP request
or HTTP response.
Only registered filters will be called during data parsing. At any time, a
filter can be unregistered by calling the function unregister_data_filter.
include/proto/filters.h
include/types/filters.h
src/filters.c
src/flt_http_comp.c
src/proto_http.c