summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Denoyelle <adenoyelle@haproxy.com>2021-08-23 14:06:31 +0200
committerAmaury Denoyelle <adenoyelle@haproxy.com>2021-08-25 15:53:54 +0200
commit86f3707d14c2feccbdaa89bd395622cdca4d4b34 (patch)
treed13c7c2f58b01a38e6cfa236ddacfd7f9680ce51
parent0626961ad3d3153f6761dbdd4336296acbde0864 (diff)
downloadhaproxy-86f3707d14c2feccbdaa89bd395622cdca4d4b34.tar.gz
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.
-rw-r--r--src/hlua_fcn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index 26aa50984..f7120f23f 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)