diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-08 15:28:32 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-08 15:28:32 +0000 |
commit | 239e9d59b1bd186c21b8c4f873516a50ed5bfd43 (patch) | |
tree | 38542cb93a22e6602889ad3f4cd9bb8bf1849b3d /src | |
parent | d4c9304de9add00b4c1852b81fb1dfbdda694ca7 (diff) | |
download | rspamd-239e9d59b1bd186c21b8c4f873516a50ed5bfd43.tar.gz rspamd-239e9d59b1bd186c21b8c4f873516a50ed5bfd43.zip |
Redis replies can also be strings
Diffstat (limited to 'src')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |