Allow PUBSUB NUMSUB without channels.

The result is an empty list but it is handy to call it programmatically.
This commit is contained in:
antirez 2013-06-20 15:34:56 +02:00
parent 455563faec
commit 519c9e11d1

View File

@ -336,8 +336,8 @@ void pubsubCommand(redisClient *c) {
}
dictReleaseIterator(di);
setDeferredMultiBulkLength(c,replylen,mblen);
} else if (!strcasecmp(c->argv[1]->ptr,"numsub") && c->argc > 2) {
/* PUBSUB NUMSUB Channel_1 [... Channel_N] */
} else if (!strcasecmp(c->argv[1]->ptr,"numsub") && c->argc >= 2) {
/* PUBSUB NUMSUB [Channel_1 ... Channel_N] */
int j;
addReplyMultiBulkLen(c,(c->argc-2)*2);