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 26aa509..f7120f2 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -910,7 +910,9 @@
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)