From: Vsevolod Stakhov Date: Mon, 9 Jan 2017 16:15:38 +0000 (+0000) Subject: [Fix] Fix plugins callbacks in webui X-Git-Tag: 1.5.0~397 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=390cd6c2066ebb08cdb21be9865635254bcc7457;p=thirdparty%2Frspamd.git [Fix] Fix plugins callbacks in webui --- diff --git a/src/controller.c b/src/controller.c index 71c2c895dc..27d7c407b0 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); }