From 239e9d59b1bd186c21b8c4f873516a50ed5bfd43 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 8 Jan 2016 15:28:32 +0000 Subject: [PATCH] Redis replies can also be strings --- src/libstat/backends/redis_backend.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index cf65d91b0..8863fb8fe 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -434,6 +434,7 @@ rspamd_redis_processed (redisAsyncContext *c, gpointer r, gpointer priv) struct rspamd_task *task; rspamd_token_t *tok; guint i, processed = 0, found = 0; + gulong val; task = rt->task; @@ -450,6 +451,12 @@ rspamd_redis_processed (redisAsyncContext *c, gpointer r, gpointer priv) tok->values[rt->id] = elt->integer; found ++; } + else if (elt->type == REDIS_REPLY_STRING) { + tok = g_ptr_array_index (task->tokens, i); + rspamd_strtoul (elt->str, elt->len, &val); + tok->values[rt->id] = val; + found ++; + } else { tok->values[rt->id] = 0; } -- 2.39.5