summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungjin Kim <kim@hyjin.com>2017-01-30 20:00:04 +0900
committerHyungjin Kim <kim@hyjin.com>2017-01-30 20:00:04 +0900
commitbe76c56b519a0390a7d7b0535685cdaa8254388e (patch)
treec5e879b4bb82cda5d7d3d5e46be70c0d07a0cb00
parent073dc84399d29a2648aa20ad687524795d13609e (diff)
Consider sub by pattern when clear subscribed flag
-rw-r--r--async.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/async.c b/async.c
index 3654580..e3f5ac3 100644
--- a/async.c
+++ b/async.c
@@ -407,7 +407,9 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply,
assert(reply->element[2]->type == REDIS_REPLY_INTEGER);
/* Unset subscribed flag only when no pipelined pending subscribe. */
- if (reply->element[2]->integer == 0 && dictSize(callbacks) == 0)
+ if (reply->element[2]->integer == 0
+ && dictSize(ac->sub.channels) == 0
+ && dictSize(ac->sub.patterns) == 0)
c->flags &= ~REDIS_SUBSCRIBED;
}
}