/* Clear stack from globals */
lua_pop (L, 4);
- rspamd_lua_set_path (L, cfg, vars);
+ rspamd_lua_set_path (L, cfg->rcl_obj, vars);
/* Set known paths as rspamd_paths global */
lua_getglobal (L, "rspamd_paths");
}
void
-rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg, GHashTable *vars)
+rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars)
{
const gchar *old_path, *additional_path = NULL;
const ucl_object_t *opts;
return;
}
- if (cfg) {
- opts = ucl_object_lookup (cfg->rcl_obj, "options");
+ if (cfg_obj) {
+ opts = ucl_object_lookup (cfg_obj, "options");
if (opts != NULL) {
opts = ucl_object_lookup (opts, "lua_path");
if (opts != NULL && ucl_object_type (opts) == UCL_STRING) {
GString *tb;
gint err_idx;
- rspamd_lua_set_path (L, cfg, vars);
+ rspamd_lua_set_path (L, cfg->rcl_obj, vars);
cur = g_list_first (cfg->script_modules);
while (cur) {
void rspamd_lua_dumpstack (lua_State *L);
/* Set lua path according to the configuration */
-void rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg,
+void rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj,
GHashTable *vars);
struct memory_pool_s * rspamd_lua_check_mempool (lua_State * L, gint pos);