]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: hlua/filters: make HTTPMessage.eom/may_recv relative to the filter's...
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Oct 2026 12:46:51 +0000 (12:46 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 23 Oct 2026 17:42:37 +0000 (19:42 +0200)
commita6b7aa18dff0733ed5d012eb552b0a8f7a9b7481
treef95e34be5692be67b8ccf56acec91466b29e43b1
parent0676fccefb8b7be7f057502fbd97c4798a8932ac
BUG/MEDIUM: hlua/filters: make HTTPMessage.eom/may_recv relative to the filter's data

HTTPMessage.eom() and HTTPMessage.may_recv() rely on the whole HTX message
to know if more data are expected or not, by testing if the end of message
was reached. However when several Lua filters are chained on a channel and
an earlier one holds back some data (for instance to rewrite the body), the
next ones may perform a test on data it should not see. This could lead to
unexpected behavior, mainly by disclosing too early the end of the message
to next layer.

Now an help function is used to know if all data are visible or
not. HTTPMessage.eom() is always false is all data are not visible by the
current filter and HTTPMessage.may_recv() always true in that case.

This should be backported to all supported versions but it will have to be
adapted because the HTX API was changed in 3.5.
doc/lua-api/index.rst
src/hlua.c