aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-03-05 21:41:46 +0600
committerGitHub <noreply@github.com>2024-03-05 21:41:46 +0600
commit5c8a7059412bead76bb0fb464856fca28fd2ec33 (patch)
treedf0ac1b47cfb5812efe68428d0365470d6feef31 /src/lua/lua_worker.c
parent4ddfbe0a6e705550412f6499ecaf67c035fe191d (diff)
parentbcd36f79596a8666217d29088f6b0040c6cf092b (diff)
downloadrspamd-5c8a7059412bead76bb0fb464856fca28fd2ec33.tar.gz
rspamd-5c8a7059412bead76bb0fb464856fca28fd2ec33.zip
Merge pull request #4857 from rspamd/vstakhov-lua-udata-opt
[Project] Optimization of userdata hashing
Diffstat (limited to 'src/lua/lua_worker.c')
-rw-r--r--src/lua/lua_worker.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lua/lua_worker.c b/src/lua/lua_worker.c
index 025b97ba1..9bf2a2469 100644
--- a/src/lua/lua_worker.c
+++ b/src/lua/lua_worker.c
@@ -63,7 +63,7 @@ const luaL_reg worker_reg[] = {
static struct rspamd_worker *
lua_check_worker(lua_State *L, gint pos)
{
- void *ud = rspamd_lua_check_udata(L, pos, "rspamd{worker}");
+ void *ud = rspamd_lua_check_udata(L, pos, rspamd_worker_classname);
luaL_argcheck(L, ud != NULL, pos, "'worker' expected");
return ud ? *((struct rspamd_worker **) ud) : NULL;
}
@@ -309,7 +309,7 @@ lua_worker_control_handler(struct rspamd_main *rspamd_main,
err_idx = lua_gettop(L);
lua_rawgeti(L, LUA_REGISTRYINDEX, cbd->cbref);
psession = lua_newuserdata(L, sizeof(*psession));
- rspamd_lua_setclass(L, "rspamd{session}", -1);
+ rspamd_lua_setclass(L, rspamd_session_classname, -1);
*psession = session;
/* Command name */
@@ -879,5 +879,5 @@ lua_worker_spawn_process(lua_State *L)
void luaopen_worker(lua_State *L)
{
- rspamd_lua_new_class(L, "rspamd{worker}", worker_reg);
+ rspamd_lua_new_class(L, rspamd_worker_classname, worker_reg);
}