From: Willy Tarreau Date: Wed, 17 Jul 2019 09:51:35 +0000 (+0200) Subject: MINOR: lua: use conn_get_{src,dst} to retrieve connection addresses X-Git-Tag: v2.1-dev2~320 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=428d8e32f4f4598b59017d387e8d17fdf114705f;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/hlua.c b/src/hlua.c index fe67f045f4..37d576f0d4 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2258,8 +2258,7 @@ __LJMP static int hlua_socket_getpeername(struct lua_State *L) return 1; } - conn_get_to_addr(conn); - if (!(conn->flags & CO_FL_ADDR_TO_SET)) { + if (!conn_get_dst(conn)) { xref_unlock(&socket->xref, peer); lua_pushnil(L); return 1; @@ -2308,8 +2307,7 @@ static int hlua_socket_getsockname(struct lua_State *L) return 1; } - conn_get_from_addr(conn); - if (!(conn->flags & CO_FL_ADDR_FROM_SET)) { + if (!conn_get_src(conn)) { xref_unlock(&socket->xref, peer); lua_pushnil(L); return 1;