From: Baptiste Assmann Date: Thu, 26 Oct 2017 19:51:58 +0000 (+0200) Subject: MINOR: lua: add uuid to the Class Proxy X-Git-Tag: v1.8-rc1~219 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46c72551f36b982d117cf89537430699305a3c15;p=thirdparty%2Fhaproxy.git MINOR: lua: add uuid to the Class Proxy the proxy UUID parameter is not set in the Lua Proxy Class. This patches adds it. --- diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst index 822f8bc978..96367f601b 100644 --- a/doc/lua-api/index.rst +++ b/doc/lua-api/index.rst @@ -823,6 +823,10 @@ Proxy class Contain the name of the proxy. +.. js:attribute:: Proxy.uuid + + Contain the unique identifier of the proxy. + .. js:attribute:: Proxy.servers Contain an array with the attached servers. Each server entry is an object of diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index 2ae1bbb29e..9a7e65722b 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -781,6 +781,12 @@ int hlua_fcn_new_proxy(lua_State *L, struct proxy *px) lua_pushstring(L, px->id); lua_settable(L, -3); + /* Add proxy uuid. */ + lua_pushstring(L, "uuid"); + snprintf(buffer, sizeof(buffer), "%d", px->uuid); + lua_pushstring(L, buffer); + lua_settable(L, -3); + /* Browse and register servers. */ lua_pushstring(L, "servers"); lua_newtable(L);