return regexp_module_config (cfg);
}
-static gboolean rspamd_lua_call_expression_func(
- struct ucl_lua_funcdata *lua_data, struct rspamd_task *task,
- GArray *args, gint *res)
+static gboolean
+rspamd_lua_call_expression_func (struct ucl_lua_funcdata *lua_data,
+ struct rspamd_task *task,
+ GArray *args, gint *res,
+ const gchar *symbol)
{
lua_State *L = lua_data->L;
struct rspamd_task **ptask;
lua_pushboolean (L, (gboolean) GPOINTER_TO_SIZE(arg->data));
break;
default:
- msg_err_task ("cannot pass custom params to lua function");
+ msg_err_task ("%s: cannot pass custom params to lua function",
+ symbol);
return FALSE;
}
}
}
if (lua_pcall (L, nargs + 1, 1, 0) != 0) {
- msg_info_task ("call to lua function failed: %s", lua_tostring (L, -1));
+ msg_info_task ("%s: call to lua function failed: %s", symbol,
+ lua_tostring (L, -1));
return FALSE;
}
pop++;
*res = lua_toboolean (L, -1);
}
else {
- msg_info_task ("lua function must return a boolean");
+ msg_info_task ("%s: lua function must return a boolean", symbol);
+ *res = FALSE;
}
lua_pop (L, pop);
/* Just call function */
res = FALSE;
if (!rspamd_lua_call_expression_func (item->lua_function, task, NULL,
- &res)) {
+ &res, item->symbol)) {
msg_err_task ("error occurred when checking symbol %s",
item->symbol);
}