statfile_normalize_func normalizer; /**< function that is used as normaliser */
void *normalizer_data; /**< normalizer function params */
gchar *normalizer_str; /**< source string (for dump) */
- GHashTable *opts; /**< different statfile options */
+ ucl_object_t *opts; /**< other options */
gboolean is_spam; /**< spam flag */
};
return FALSE;
}
+ st->opts = obj;
+
return TRUE;
}
if (c == NULL) {
c = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct statfile));
}
- if (c->opts == NULL) {
- c->opts = g_hash_table_new (rspamd_str_hash, rspamd_str_equal);
- memory_pool_add_destructor (cfg->cfg_pool, (pool_destruct_func) g_hash_table_destroy, c->opts);
- }
return c;
}
top = ud->parent_pointer[ud->nested - 1];
ud->parent_pointer[ud->nested - 1] =
- ucl_object_insert_key (top, ucl_object_fromstring_common (text, text_len, UCL_STRING_PARSE),
+ ucl_object_insert_key (top, ucl_object_fromstring_common (text, text_len,
+ UCL_STRING_PARSE|UCL_STRING_PARSE_BYTES),
ud->section_name[ud->nested], 0, true);
}
lua_statfile_get_param (lua_State *L)
{
struct statfile *st = lua_check_statfile (L);
- const gchar *param, *value;
+ const gchar *param;
+ ucl_object_t *value;
param = luaL_checkstring (L, 2);
if (st != NULL && param != NULL) {
- value = g_hash_table_lookup (st->opts, param);
+ value = ucl_object_find_key (st->opts, param);
if (value != NULL) {
- lua_pushstring (L, value);
+ lua_pushstring (L, ucl_object_tostring_forced (value));
return 1;
}
}