diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 09:59:52 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 09:59:52 +0000 |
commit | 6bc5286496c43a0ee9f1a616507c7aa03e28450c (patch) | |
tree | 9a6ed4374aaf129777560ba58f608368fb8754df /src/libstat/learn_cache | |
parent | 153e64677902c1acc7a1e8ee21d5b634d8a65885 (diff) | |
download | rspamd-6bc5286496c43a0ee9f1a616507c7aa03e28450c.tar.gz rspamd-6bc5286496c43a0ee9f1a616507c7aa03e28450c.zip |
Refactor UCL API
Diffstat (limited to 'src/libstat/learn_cache')
-rw-r--r-- | src/libstat/learn_cache/redis_cache.c | 10 | ||||
-rw-r--r-- | src/libstat/learn_cache/sqlite3_cache.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index 47bfd89a6..6dc9d5336 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -185,11 +185,11 @@ rspamd_stat_cache_redis_init (struct rspamd_stat_ctx *ctx, cache_ctx = g_slice_alloc0 (sizeof (*cache_ctx)); - elt = ucl_object_find_any_key (stf->opts, "read_servers", "servers", NULL); + elt = ucl_object_lookup_any (stf->opts, "read_servers", "servers", NULL); if (elt == NULL) { if (st->classifier->cfg->opts) { - elt = ucl_object_find_any_key (st->classifier->cfg->opts, + elt = ucl_object_lookup_any (st->classifier->cfg->opts, "read_servers", "servers", NULL); } @@ -209,7 +209,7 @@ rspamd_stat_cache_redis_init (struct rspamd_stat_ctx *ctx, return NULL; } - elt = ucl_object_find_key (stf->opts, "write_servers"); + elt = ucl_object_lookup (stf->opts, "write_servers"); if (elt == NULL) { /* Use read servers as write ones */ g_assert (relt != NULL); @@ -232,7 +232,7 @@ rspamd_stat_cache_redis_init (struct rspamd_stat_ctx *ctx, } } - elt = ucl_object_find_key (stf->opts, "key"); + elt = ucl_object_lookup (stf->opts, "key"); if (elt == NULL || ucl_object_type (elt) != UCL_STRING) { cache_ctx->redis_object = DEFAULT_REDIS_KEY; } @@ -240,7 +240,7 @@ rspamd_stat_cache_redis_init (struct rspamd_stat_ctx *ctx, cache_ctx->redis_object = ucl_object_tostring (elt); } - elt = ucl_object_find_key (stf->opts, "timeout"); + elt = ucl_object_lookup (stf->opts, "timeout"); if (elt) { cache_ctx->timeout = ucl_object_todouble (elt); } diff --git a/src/libstat/learn_cache/sqlite3_cache.c b/src/libstat/learn_cache/sqlite3_cache.c index 41731fa10..61335ab34 100644 --- a/src/libstat/learn_cache/sqlite3_cache.c +++ b/src/libstat/learn_cache/sqlite3_cache.c @@ -125,7 +125,7 @@ rspamd_stat_cache_sqlite3_init (struct rspamd_stat_ctx *ctx, GError *err = NULL; if (cf) { - elt = ucl_object_find_any_key (cf, "path", "file", NULL); + elt = ucl_object_lookup_any (cf, "path", "file", NULL); if (elt != NULL) { path = ucl_object_tostring (elt); |