aboutsummaryrefslogtreecommitdiffstats
path: root/src/log_helper.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-03 16:31:07 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-04 14:13:07 +0000
commit3b5bb8abc2d116ceb4a8c041075d84851e2711c4 (patch)
tree488309725db38ee0bc03bc992cba9ae5ae7345e8 /src/log_helper.c
parent854f8bd4291a5402408caaba20cbb5064521a0b2 (diff)
downloadrspamd-3b5bb8abc2d116ceb4a8c041075d84851e2711c4.tar.gz
rspamd-3b5bb8abc2d116ceb4a8c041075d84851e2711c4.zip
[Minor] Store ev_base for log_helper callbacks
Diffstat (limited to 'src/log_helper.c')
-rw-r--r--src/log_helper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/log_helper.c b/src/log_helper.c
index 74541f62b..29cb511a3 100644
--- a/src/log_helper.c
+++ b/src/log_helper.c
@@ -81,6 +81,7 @@ rspamd_log_helper_read (gint fd, short what, gpointer ud)
struct rspamd_protocol_log_message_sum *sm;
struct rspamd_worker_lua_script *sc;
struct rspamd_config **pcfg;
+ struct event_base **pevbase;
r = read (fd, buf, sizeof (buf));
@@ -131,7 +132,11 @@ rspamd_log_helper_read (gint fd, short what, gpointer ud)
lua_rawseti (ctx->L, -2, (i + 1));
}
- if (lua_pcall (ctx->L, 6, 0, 0) != 0) {
+ pevbase = lua_newuserdata (ctx->L, sizeof (*pevbase));
+ *pevbase = ctx->ev_base;
+ rspamd_lua_setclass (ctx->L, "rspamd{ev_base}", -1);
+
+ if (lua_pcall (ctx->L, 7, 0, 0) != 0) {
msg_err ("error executing log handler code: %s",
lua_tostring (ctx->L, -1));
lua_pop (ctx->L, 1);