]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Some fixes to the previous commit
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Feb 2016 11:08:24 +0000 (11:08 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Feb 2016 11:08:24 +0000 (11:08 +0000)
src/libstat/backends/redis_backend.c
src/libstat/learn_cache/redis_cache.c

index 6e1767e8d99d9fd6e12755bc2b207e258baa8e4c..ae47eef9faee01dfcce3c963299f1f4985a35333 100644 (file)
@@ -1194,6 +1194,8 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens,
        double_to_tv (rt->ctx->timeout, &tv);
        event_add (&rt->timeout_event, &tv);
 
+       rspamd_redis_maybe_auth (rt->ctx, rt->redis);
+
        if (rt->stcf->clcf->flags & RSPAMD_FLAG_CLASSIFIER_INTEGER) {
                redis_cmd = "HINCRBY";
        }
index e76e6b2b687c014920700c00a5672c443681b37a..b48aeecea8030d546d8179126d7150530dd2c928 100644 (file)
@@ -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;