]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: hlua: Don't loop if a lua socket does not consume received data
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Feb 2024 14:33:44 +0000 (15:33 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Feb 2024 14:48:08 +0000 (15:48 +0100)
commit56e73df37d9572f5401e20434682568f7d09a860
tree5952ff836ef1e0bc5d834febcf1ffae8e42ac4d8
parent38534d344bdcdbfee72291b847087d0424f56529
BUG/MEDIUM: hlua: Don't loop if a lua socket does not consume received data

If some data are received for a lua socket while the lua script responsible
to consume these data is not ready to do so, for instance because it is
sleeping, the applet is woken up in loop because it never states it will not
consume these data yet.

To fix the issue, in the applet I/O handle, when there are outgoing data, we
always pretend the applet will not consume it. It is the responsibility to
the lua script to reactivate receives by calling Socket.receive() function.

This patch must be backported to every stable version. For 2.4 and older,
si_want_get()/si_cant_get() must be used instead of
applet_will_consume()/applet_wont_consume().
src/hlua.c