]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix Redis query
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Feb 2018 15:57:13 +0000 (15:57 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Feb 2018 15:57:33 +0000 (15:57 +0000)
src/libstat/backends/redis_backend.c

index 6e0201db9e2d6ce247aedabbe583d88c83d42022..df631f722ad9d3a5ef9854c99332266f5b7069a3 100644 (file)
@@ -1702,12 +1702,13 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens,
                                "HINCRBY\r\n"
                                "$%d\r\n"
                                "%s\r\n"
-                               "$6\r\n"
+                               "$%d\r\n"
                                "%s\r\n" /* Learned key */
                                "$1\r\n"
                                "1\r\n",
                                (gint)strlen (rt->redis_object_expanded),
                                rt->redis_object_expanded,
+                               (gint)strlen (learned_key),
                                learned_key);
        }
        else {
@@ -1717,12 +1718,13 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens,
                                "HINCRBY\r\n"
                                "$%d\r\n"
                                "%s\r\n"
-                               "$6\r\n"
+                               "$%d\r\n"
                                "%s\r\n" /* Learned key */
                                "$2\r\n"
                                "-1\r\n",
                                (gint)strlen (rt->redis_object_expanded),
                                rt->redis_object_expanded,
+                               (gint)strlen (learned_key),
                                learned_key);
        }