From: Amaury Denoyelle Date: Mon, 23 Aug 2021 12:06:31 +0000 (+0200) Subject: MINOR: server: mark servers referenced by LUA script as non purgeable X-Git-Tag: v2.5-dev5~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86f3707d14c2feccbdaa89bd395622cdca4d4b34;p=thirdparty%2Fhaproxy.git MINOR: server: mark servers referenced by LUA script as non purgeable Each server that is retrieved by a LUA script is marked as non purgeable. Note that for this to work, the script must have been executed already once. --- diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index 26aa509842..f7120f23fa 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -910,7 +910,9 @@ int hlua_fcn_new_server(lua_State *L, struct server *srv) static struct server *hlua_check_server(lua_State *L, int ud) { - return hlua_checkudata(L, ud, class_server_ref); + struct server *srv = hlua_checkudata(L, ud, class_server_ref); + srv->flags |= SRV_F_NON_PURGEABLE; + return srv; } int hlua_server_get_stats(lua_State *L)