From: Christopher Faulet Date: Wed, 26 Feb 2020 14:47:22 +0000 (+0100) Subject: BUG/MINOR: filters: Forward everything if no data filters are called X-Git-Tag: v2.2-dev4~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81340d7b533ac24cb791fbebede4f7bb36a9f007;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/filters.c b/src/filters.c index c4601febe7..e275050408 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 */