]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: hlua/filters: Restrict HTTPMessage.set_eom/unset_eom to visible data
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 23 Oct 2026 07:23:28 +0000 (09:23 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 23 Oct 2026 17:43:33 +0000 (19:43 +0200)
commit4c29e446044f4f0c85bba80158b370eae228ac6e
tree4e41f917e110c6314712ea890871d069fe12ca97
parentbd8e3642a613879519fec6ecf9c76a598ce0599a
BUG/MINOR: hlua/filters: Restrict HTTPMessage.set_eom/unset_eom to visible data

HTTPMessage.set_eom() and HTTPMessage.unset_eom() manipulate the EOM flag
of the whole HTX message, without checking the data visible by the calling
filter. But when several Lua filters are chained on a channel and an
earlier one holds back some data (for instance to rewrite the body), the
end of the message may be reached by this filter while the current one
still waits for data held upstream. In that case, setting the EOM would
duplicate it, and unsetting it could not remove the flag from the data
held by the earlier filter.

Now both functions can only be called when all data of the message are
visible by the current filter, like HTTPMessage.eom(),
HTTPMessage.may_recv() and HTTPMessage.closed(). Otherwise an error is
raised. The error message of HTTPMessage.unset_eom() was also fixed: it
referred to the 'set_eom' function.

This patch should be backported to all supported versions.
src/hlua.c