]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: hlua/filters: Make Channel.may_recv relative to the filter's 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)
commit67ef257e44ab01808885480671435058f163b052
treedff18a68d7219b7ab2da85fff8c4eb5cc9b6211f
parent4c29e446044f4f0c85bba80158b370eae228ac6e
BUG/MEDIUM: hlua/filters: Make Channel.may_recv relative to the filter's data

Channel.may_recv() tested the whole channel to know if more data may be
received, ignoring 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 channel input may be closed while
the current filter still waits for data held upstream. In that case, the
function must return true, because the held data can still be exposed to
the filter, even if nothing will be received on the connection anymore.

Now, like HTTPMessage.eom(), HTTPMessage.may_recv() and
HTTPMessage.closed(), the result is relative to the data visible by the
current filter: the function always returns true if an earlier filter
holds back data.

This patch should be backported to all supported versions.
doc/lua-api/index.rst
src/hlua.c