Unsubscribe messages always have 3 elements

This commit is contained in:
Pieter Noordhuis 2010-12-31 14:40:39 +01:00
parent ed97945c27
commit ec922cd007
1 changed files with 2 additions and 2 deletions

View File

@ -330,8 +330,8 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply,
/* If this was the last unsubscribe message, revert to
* non-subscribe mode. */
assert(reply->element[2+pvariant]->type == REDIS_REPLY_INTEGER);
if (reply->element[2+pvariant]->integer == 0)
assert(reply->element[2]->type == REDIS_REPLY_INTEGER);
if (reply->element[2]->integer == 0)
c->flags &= ~REDIS_SUBSCRIBED;
}
}