aboutsummaryrefslogtreecommitdiffstats
path: root/src/controller.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-09 16:15:38 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-09 16:15:38 +0000
commit390cd6c2066ebb08cdb21be9865635254bcc7457 (patch)
tree89a57be98ab2ee9b107522ce28f80e40bf1d3588 /src/controller.c
parenta44ad6b4002efdba33959c704aa25272a5999cd0 (diff)
downloadrspamd-390cd6c2066ebb08cdb21be9865635254bcc7457.tar.gz
rspamd-390cd6c2066ebb08cdb21be9865635254bcc7457.zip
[Fix] Fix plugins callbacks in webui
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/controller.c b/src/controller.c
index 71c2c895d..27d7c407b 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -2615,8 +2615,6 @@ rspamd_controller_handle_lua_plugin (struct rspamd_http_connection_entry *conn_e
return 0;
}
- /* Callback */
- lua_rawgeti (L, LUA_REGISTRYINDEX, cbd->handler->idx);
task = rspamd_task_new (session->ctx->worker, session->cfg);
task->resolver = ctx->resolver;
@@ -2640,6 +2638,9 @@ rspamd_controller_handle_lua_plugin (struct rspamd_http_connection_entry *conn_e
}
}
+ /* Callback */
+ lua_rawgeti (L, LUA_REGISTRYINDEX, cbd->handler->idx);
+
ptask = lua_newuserdata (L, sizeof (*ptask));
rspamd_lua_setclass (L, "rspamd{task}", -1);
*ptask = task;
@@ -3052,7 +3053,7 @@ static const struct luaL_reg lua_csessionlib_m[] = {
static void
luaopen_controller (lua_State * L)
{
- rspamd_lua_new_class (L, "rspamd{url}", lua_csessionlib_m);
+ rspamd_lua_new_class (L, "rspamd{csession}", lua_csessionlib_m);
lua_pop (L, 1);
}