From: Christopher Faulet Date: Thu, 30 Jul 2026 14:20:44 +0000 (+0200) Subject: BUG/MEDIUM: filter: Disable auto-close on channel during TCP payload filtering X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e96a8b3d0f546f4348e213b43c4f7a86f1693356;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: filter: Disable auto-close on channel during TCP payload filtering While a filter is registered on the payload filter in TCP, it is important to disable the auto-cloes on the corresponding channel. It is already performed in HTTP. It is only an issue when the ->tcp_payload callback function is defined. Without this patch, the data blocked in a filter may be lost when the producer shut its connection. In that case, we must take care to wait the filter flushes pending data. This patch should fix the issue #3457. It must be backported to all supported versions. --- diff --git a/src/filters.c b/src/filters.c index b9edfe5f5..bcb311c70 100644 --- a/src/filters.c +++ b/src/filters.c @@ -1329,7 +1329,15 @@ flt_xfer_data(struct stream *s, struct channel *chn, unsigned int an_bit) /* Wait for data */ DBG_TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA|STRM_EV_FLT_ANA, s); + + /* DATA filtering is not finished and some data may still be blocked in + * the channel. So take care to disable auto close + */ + if (HAS_DATA_FILTERS(s, chn)) + channel_dont_close(chn); + return 0; + end: /* Terminate the data filtering. If is negative, an error was * encountered during the filtering. */