mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: lua: use conn_get_{src,dst} to retrieve connection addresses
This replaces the previous conn_get_{from,to}_addr() and reuses the existing error checks.
This commit is contained in:
parent
83b5890b47
commit
428d8e32f4
@ -2258,8 +2258,7 @@ __LJMP static int hlua_socket_getpeername(struct lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn_get_to_addr(conn);
|
if (!conn_get_dst(conn)) {
|
||||||
if (!(conn->flags & CO_FL_ADDR_TO_SET)) {
|
|
||||||
xref_unlock(&socket->xref, peer);
|
xref_unlock(&socket->xref, peer);
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
@ -2308,8 +2307,7 @@ static int hlua_socket_getsockname(struct lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn_get_from_addr(conn);
|
if (!conn_get_src(conn)) {
|
||||||
if (!(conn->flags & CO_FL_ADDR_FROM_SET)) {
|
|
||||||
xref_unlock(&socket->xref, peer);
|
xref_unlock(&socket->xref, peer);
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user