From 81340d7b533ac24cb791fbebede4f7bb36a9f007 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 26 Feb 2020 15:47:22 +0100 Subject: [PATCH] BUG/MINOR: filters: Forward everything if no data filters are called If a filter enable the data filtering, in TCP or in HTTP, but it does not defined the corresponding callback function (so http_payload() or tcp_payload()), it will be ignored. If all configured data filter do the same, we must be sure to forward everything. Otherwise nothing will be forwarded at all. This patch must be forwarded as far as 1.9. --- src/filters.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/filters.c b/src/filters.c index c4601febe..e27505040 100644 --- a/src/filters.c +++ b/src/filters.c @@ -611,8 +611,9 @@ flt_http_payload(struct stream *s, struct http_msg *msg, unsigned int len) struct filter *filter; unsigned long long *strm_off = &FLT_STRM_OFF(s, msg->chn); unsigned int out = co_data(msg->chn); - int ret = 0, data = len - out; + int ret, data; + ret = data = len - out; DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_FLT_ANA, s, s->txn, msg); list_for_each_entry(filter, &strm_flt(s)->filters, list) { /* Call "data" filters only */ @@ -875,8 +876,9 @@ flt_tcp_payload(struct stream *s, struct channel *chn, unsigned int len) struct filter *filter; unsigned long long *strm_off = &FLT_STRM_OFF(s, chn); unsigned int out = co_data(chn); - int ret = 0, data = len - out; + int ret, data; + ret = data = len - out; DBG_TRACE_ENTER(STRM_EV_TCP_ANA|STRM_EV_FLT_ANA, s); list_for_each_entry(filter, &strm_flt(s)->filters, list) { /* Call "data" filters only */