From 03794f380661f25c96e191a97a01b4e81c24da13 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 5 Nov 2016 23:26:21 +0100 Subject: [PATCH] [Fix] Really fix redis shingles check --- src/libserver/fuzzy_backend_redis.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c index f585fa341..b89dde8cc 100644 --- a/src/libserver/fuzzy_backend_redis.c +++ b/src/libserver/fuzzy_backend_redis.c @@ -475,8 +475,8 @@ rspamd_fuzzy_backend_check_shingles (struct rspamd_fuzzy_redis_session *session) for (i = 0; i < RSPAMD_SHINGLE_SIZE; i ++) { key = g_string_new (session->backend->redis_object); rspamd_printf_gstring (key, "_%d_%uL", i, shcmd->sgl.hashes[i]); - session->argv[i] = key->str; - session->argv_lens[i] = key->len; + session->argv[i + 1] = key->str; + session->argv_lens[i + 1] = key->len; g_string_free (key, FALSE); /* Do not free underlying array */ } @@ -488,6 +488,8 @@ rspamd_fuzzy_backend_check_shingles (struct rspamd_fuzzy_redis_session *session) if (redisAsyncCommandArgv (session->ctx, rspamd_fuzzy_redis_shingles_callback, session, session->nargs, (const gchar **)session->argv, session->argv_lens) != REDIS_OK) { + msg_err ("cannot execute redis command: %s", session->ctx->errstr); + if (session->callback.cb_check) { memset (&rep, 0, sizeof (rep)); session->callback.cb_check (&rep, session->cbdata); -- 2.39.5