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().

(cherry picked from commit 56e73df37d9572f5401e20434682568f7d09a860)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit f829972e82ab5a24e9378d7ec25a82bd5c97f0f1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0dbc16b39de4c3f2fd3ea8f3b22636f9753909c3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 22d3b80a88f590480ad9cadf00fc6637d57e2510)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit cacf5105fddb0efdb84cb14bfefc4d4e4498cf2d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed