* @param reconfig
* @return
*/
-gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig,
- GHashTable *vars);
+gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig);
/**
* Add new symbol to the metric
MIN (sizeof (cfg->cfg_pool->tag.uid), strlen (cfg->checksum)));
top = rspamd_rcl_config_init (cfg);
+ rspamd_lua_set_path (cfg->lua_state, cfg->rcl_obj, vars);
rspamd_rcl_set_lua_globals (cfg, cfg->lua_state, vars);
rspamd_mempool_add_destructor (cfg->cfg_pool, rspamd_rcl_section_free, top);
err = NULL;
}
gboolean
-rspamd_init_filters (struct rspamd_config *cfg, bool reconfig, GHashTable *vars)
+rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
{
GList *cur;
module_t *mod, **pmod;
cur = g_list_next (cur);
}
- return rspamd_init_lua_filters (cfg, 0, vars);
+ return rspamd_init_lua_filters (cfg, 0);
}
static void
}
gboolean
-rspamd_init_lua_filters (struct rspamd_config *cfg, gboolean force_load,
- GHashTable *vars)
+rspamd_init_lua_filters (struct rspamd_config *cfg, gboolean force_load)
{
struct rspamd_config **pcfg;
GList *cur;
GString *tb;
gint err_idx;
- rspamd_lua_set_path (L, cfg->rcl_obj, vars);
cur = g_list_first (cfg->script_modules);
while (cur) {
* Load and initialize lua plugins
*/
gboolean
-rspamd_init_lua_filters (struct rspamd_config *cfg, gboolean force_load,
- GHashTable *vars);
+rspamd_init_lua_filters (struct rspamd_config *cfg, gboolean force_load);
/**
* Initialize new locked lua_State structure
if (cfg != NULL && message != NULL) {
base = event_init ();
- rspamd_init_filters (cfg, FALSE, NULL);
+ rspamd_init_filters (cfg, FALSE);
task = rspamd_task_new (NULL, cfg, NULL);
task->ev_base = base;
task->msg.begin = rspamd_mempool_alloc (task->task_pool, mlen);
}
else {
/* Do post-load actions */
+ rspamd_lua_set_path (cfg->lua_state, cfg->rcl_obj, ucl_vars);
rspamd_lua_post_load_config (cfg);
- if (!rspamd_init_filters (rspamd_main->cfg, FALSE, ucl_vars)) {
+ if (!rspamd_init_filters (rspamd_main->cfg, FALSE)) {
ret = FALSE;
}
#include "cfg_rcl.h"
#include "rspamd.h"
#include "lua/lua_common.h"
-#include "confighelp.lua.h"
static gboolean json = FALSE;
static gboolean compact = FALSE;
}
/* Init lua modules */
- rspamd_init_lua_filters (cfg, TRUE, ucl_vars);
+ rspamd_lua_set_path (cfg->lua_state, cfg->rcl_obj, ucl_vars);
+ rspamd_init_lua_filters (cfg, TRUE);
if (argc > 1) {
for (i = 1; i < argc; i ++) {
/* Do post-load actions */
rspamd_lua_post_load_config (cfg);
- if (!rspamd_init_filters (rspamd_main->cfg, FALSE, ucl_vars)) {
+ if (!rspamd_init_filters (rspamd_main->cfg, FALSE)) {
ret = FALSE;
}
#include <event.h>
#include "libutil/util.h"
#include "lua/lua_common.h"
-#include "fuzzy_stat.lua.h"
static gchar *control_path = RSPAMD_DBDIR "/rspamd.sock";
static gboolean json = FALSE;
cbdata->argc,
cbdata->argv,
obj,
- rspamadm_script_fuzzy_stat);
+ "fuzzy_stat");
rspamd_fstring_free (out);
ucl_object_unref (obj);
struct rspamd_config *cfg,
gboolean init_modules,
enum rspamd_post_load_options opts,
- gboolean reload,
- GHashTable *vars);
+ gboolean reload);
/* Control socket */
static gint control_fd;
if (!load_rspamd_config (rspamd_main, tmp_cfg, TRUE,
RSPAMD_CONFIG_INIT_VALIDATE|RSPAMD_CONFIG_INIT_SYMCACHE,
- TRUE, ucl_vars)) {
+ TRUE)) {
rspamd_main->cfg = old_cfg;
rspamd_log_close_priv (rspamd_main->logger,
rspamd_main->workers_uid,
load_rspamd_config (struct rspamd_main *rspamd_main,
struct rspamd_config *cfg, gboolean init_modules,
enum rspamd_post_load_options opts,
- gboolean reload,
- GHashTable *vars)
+ gboolean reload)
{
cfg->compiled_modules = modules;
cfg->compiled_workers = workers;
rspamd_lua_post_load_config (cfg);
if (init_modules) {
- rspamd_init_filters (cfg, reload, vars);
+ rspamd_init_filters (cfg, reload);
}
/* Do post-load actions */
if (config_test || dump_cache) {
if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, FALSE, 0,
- FALSE, ucl_vars)) {
+ FALSE)) {
exit (EXIT_FAILURE);
}
/* Load config */
if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, TRUE,
- RSPAMD_CONFIG_LOAD_ALL, FALSE, ucl_vars)) {
+ RSPAMD_CONFIG_LOAD_ALL, FALSE)) {
exit (EXIT_FAILURE);
}