diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-25 11:08:24 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-25 11:08:24 +0000 |
commit | 7b04b58f6942d8b1d22de5fdae166359c702c628 (patch) | |
tree | db98a28a62fc47469a5b4567e7305d75a7e56d2b /src/libstat/learn_cache | |
parent | d4cb66b5564017f6f487a0362217fa9aa2450fa9 (diff) | |
download | rspamd-7b04b58f6942d8b1d22de5fdae166359c702c628.tar.gz rspamd-7b04b58f6942d8b1d22de5fdae166359c702c628.zip |
Some fixes to the previous commit
Diffstat (limited to 'src/libstat/learn_cache')
-rw-r--r-- | src/libstat/learn_cache/redis_cache.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index e76e6b2b6..b48aeecea 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -195,7 +195,7 @@ rspamd_stat_cache_redis_init (struct rspamd_stat_ctx *ctx, { struct rspamd_redis_cache_ctx *cache_ctx; struct rspamd_statfile_config *stf = st->stcf; - const ucl_object_t *elt, *relt; + const ucl_object_t *elt, *relt, *telt; cache_ctx = g_slice_alloc0 (sizeof (*cache_ctx)); @@ -213,36 +213,36 @@ rspamd_stat_cache_redis_init (struct rspamd_stat_ctx *ctx, return NULL; } - elt = ucl_object_lookup (st->classifier->cfg->opts, "password"); - if (elt) { - cache_ctx->password = ucl_object_tostring (elt); + telt = ucl_object_lookup (st->classifier->cfg->opts, "password"); + if (telt) { + cache_ctx->password = ucl_object_tostring (telt); } else { cache_ctx->password = NULL; } - elt = ucl_object_lookup_any (st->classifier->cfg->opts, + telt = ucl_object_lookup_any (st->classifier->cfg->opts, "db", "database", NULL); - if (elt) { - cache_ctx->dbname = ucl_object_tostring (elt); + if (telt) { + cache_ctx->dbname = ucl_object_tostring (telt); } else { cache_ctx->dbname = NULL; } } else { - elt = ucl_object_lookup (stf->opts, "password"); - if (elt) { - cache_ctx->password = ucl_object_tostring (elt); + telt = ucl_object_lookup (stf->opts, "password"); + if (telt) { + cache_ctx->password = ucl_object_tostring (telt); } else { cache_ctx->password = NULL; } - elt = ucl_object_lookup_any (stf->opts, + telt = ucl_object_lookup_any (stf->opts, "db", "database", NULL); - if (elt) { - cache_ctx->dbname = ucl_object_tostring (elt); + if (telt) { + cache_ctx->dbname = ucl_object_tostring (telt); } else { cache_ctx->dbname = NULL; |