]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua: Socket.send threw runtime error: 'close' needs 1 arguments.
authorsada <sada@signalsciences.com>
Fri, 11 May 2018 18:48:18 +0000 (11:48 -0700)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 May 2018 11:48:21 +0000 (13:48 +0200)
commit05ed330d72329b74f5488eb102e0c5862b00543b
tree0f1d427dde7a7a15ade4379a4590256b703eb887
parent03f4ec47d9ffff629b07dcba9f0f134a7c7e44b2
BUG/MINOR: lua: Socket.send threw runtime error: 'close' needs 1 arguments.

Function `hlua_socket_close` expected exactly one argument on the Lua stack.
But when `hlua_socket_close` was called from `hlua_socket_write_yield`,
Lua stack had 3 arguments. So `hlua_socket_close` threw the exception with
message "'close' needs 1 arguments".

Introduced new helper function `hlua_socket_close_helper`, which removed the
Lua stack argument count check and only checked if the first argument was
a socket.

This fix should be backported to 1.8, 1.7 and 1.6.
src/hlua.c