From 6bc5286496c43a0ee9f1a616507c7aa03e28450c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 16 Feb 2016 09:59:52 +0000 Subject: Refactor UCL API --- src/libstat/learn_cache/redis_cache.c | 10 +++++----- src/libstat/learn_cache/sqlite3_cache.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libstat/learn_cache') 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); -- cgit v1.2.3