]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua/htx: Respect the reserve when data are send from an HTX applet
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Jan 2019 11:16:58 +0000 (12:16 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Jan 2019 13:36:22 +0000 (14:36 +0100)
commit4b0e9b287061e923d68f9d7e3f71c06374eed436
tree8637d7c93cb6f326569ff43dcbd0022cc184e13a
parent61ae5ca1f412d7160a8df43a2e054d7afd14cf7a
BUG/MINOR: lua/htx: Respect the reserve when data are send from an HTX applet

In the function hlua_applet_htx_send_yield(), there already was a test to
respect the reserve but the wrong function was used to get the available space
for data in the HTX buffer. Instead of calling htx_free_space(), the function
htx_free_data_space() must be used. But in fact, there is no reason to bother
with that anymore because the function channel_htx_recv_max() has been added for
this purpose.

The result of this bug is that the call to htx_add_data() failed unexpectedly
while the amount of written data was incremented, leading the applet to think
all data was sent. To prevent any futher bugs, a test has been added to yield if
we are not able to write data into the channel buffer.

This patch must be backported to 1.9.
src/hlua.c