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.
/* 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 <ret> is negative, an error was
* encountered during the filtering. */