BUG/MINOR: http-ana/filters: Wait end of the http_end callback for all filters
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Nov 2019 15:31:46 +0000 (16:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Jan 2020 08:09:08 +0000 (09:09 +0100)
commit8ece0801d813d6f821dabde13f7a74759dd95ee4
tree6fa612810a843ac6bd43f4afad212a5831e74d50
parentfb815462c6720c63d45e8fc09c35c49de6160888
BUG/MINOR: http-ana/filters: Wait end of the http_end callback for all filters

Filters may define the "http_end" callback, called at the end of the analysis of
any HTTP messages. It is called at the end of the payload forwarding and it can
interrupt the stream processing. So we must be sure to not remove the XFER_BODY
analyzers while there is still at least filter in progress on this callback.

Unfortunatly, once the request and the response are borh in the DONE or the
TUNNEL mode, we consider the XFER_BODY analyzer has finished its processing on
both sides. So it is possible to prematurely interrupt the execution of the
filters "http_end" callback.

To fix this bug, we switch a message in the ENDING state. It is then switched in
DONE/TUNNEL mode only after the execution of the filters "http_end" callback.

This patch must be backported (and adapted) to 2.1, 2.0 and 1.9. The legacy HTTP
mode shoud probaly be fixed too.

(cherry picked from commit 1a3e0279c6079174288e2e3fbbf09e530ff221c5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_ana.c