mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-29 06:18:02 +00:00
BUG/MINOR: Lua: The socket may be destroyed when we try to access.
When we try to access to other proxy context, we must check its existence because haproxy can kill it between the creation and the usage. This patch should be backported in 1.6 and 1.7
This commit is contained in:
parent
5d468ca97b
commit
b01d28f976
@ -2205,6 +2205,11 @@ __LJMP static int hlua_socket_connect(struct lua_State *L)
|
||||
|
||||
/* Get args. */
|
||||
socket = MAY_LJMP(hlua_checksocket(L, 1));
|
||||
|
||||
/* The socket may be destroy. */
|
||||
if (!socket->s)
|
||||
return 0;
|
||||
|
||||
ip = MAY_LJMP(luaL_checkstring(L, 2));
|
||||
if (lua_gettop(L) >= 3)
|
||||
port = MAY_LJMP(luaL_checkinteger(L, 3));
|
||||
|
Loading…
Reference in New Issue
Block a user