aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat
diff options
context:
space:
mode:
authorresec <resec0109@gmail.com>2019-11-19 09:31:39 +0000
committerresec <resec0109@gmail.com>2019-11-19 09:31:39 +0000
commitd98f4ef54a9fa3d8f4cf5e224f8427063b264444 (patch)
tree37ae5db490dcbfb3167338bfd930600fb2973d1f /src/libstat
parent1cb842be45ed0b12c4f4a228532604175408b591 (diff)
downloadrspamd-d98f4ef54a9fa3d8f4cf5e224f8427063b264444.tar.gz
rspamd-d98f4ef54a9fa3d8f4cf5e224f8427063b264444.zip
eliminate smembers: fix
Diffstat (limited to 'src/libstat')
-rw-r--r--src/libstat/backends/redis_backend.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index 26f33b0a1..eab238532 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -98,7 +98,6 @@ struct rspamd_redis_stat_cbdata {
redisAsyncContext *redis;
ucl_object_t *cur;
GPtrArray *cur_keys;
- guint
struct upstream *selected;
guint inflight;
gboolean wanna_die;
@@ -847,7 +846,7 @@ rspamd_redis_stat_keys (redisAsyncContext *c, gpointer r, gpointer priv)
{
struct rspamd_redis_stat_elt *redis_elt = (struct rspamd_redis_stat_elt *)priv;
struct rspamd_redis_stat_cbdata *cbdata;
- redisReply *reply = r, *more, **elts, *elt;
+ redisReply *reply = r, *more, *elts, *elt;
gchar **pk, *k;
guint i, processed = 0;
@@ -861,8 +860,8 @@ rspamd_redis_stat_keys (redisAsyncContext *c, gpointer r, gpointer priv)
if (c->err == 0 && r != NULL) {
if (reply->type == REDIS_REPLY_ARRAY) {
- more = r.element[0]
- elts = r.element[1]
+ more = reply->element[0];
+ elts = reply->element[1];
g_ptr_array_set_size (cbdata->cur_keys, elts->elements);
@@ -916,7 +915,7 @@ rspamd_redis_stat_keys (redisAsyncContext *c, gpointer r, gpointer priv)
}
}
- if (more != NULL && more.integer) {
+ if (more != NULL && more->integer) {
/* Cleanup the cbdata->cur_keys and re-allowcate */
for (i = 0; i < cbdata->cur_keys->len; i ++) {
k = g_ptr_array_index (cbdata->cur_keys, i);
@@ -930,7 +929,7 @@ rspamd_redis_stat_keys (redisAsyncContext *c, gpointer r, gpointer priv)
/* Get more keys */
redisAsyncCommand (cbdata->redis, rspamd_redis_stat_keys, redis_elt,
"SSCAN %s_keys %d COUNT 1000",
- ctx->stcf->symbol, more.integer);
+ cbdata->elt->ctx->stcf->symbol, more->integer);
}
else {
/* Set up the required keys */