X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/75b41de8ca975d01c6371a98f9e552c934af5937..1eceb85ebc127480ffe3d80be00e09472fa684ec:/src/pubsub.c diff --git a/src/pubsub.c b/src/pubsub.c index 23b0ceb0..af37df5c 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -63,10 +63,10 @@ int pubsubUnsubscribeChannel(redisClient *c, robj *channel, int notify) { retval = 1; /* Remove the client from the channel -> clients list hash table */ de = dictFind(server.pubsub_channels,channel); - redisAssert(de != NULL); + redisAssertWithInfo(c,NULL,de != NULL); clients = dictGetEntryVal(de); ln = listSearchKey(clients,c); - redisAssert(ln != NULL); + redisAssertWithInfo(c,NULL,ln != NULL); listDelNode(clients,ln); if (listLength(clients) == 0) { /* Free the list and associated hash entry at all if this was @@ -141,7 +141,7 @@ int pubsubUnsubscribePattern(redisClient *c, robj *pattern, int notify) { /* Unsubscribe from all the channels. Return the number of channels the * client was subscribed from. */ int pubsubUnsubscribeAllChannels(redisClient *c, int notify) { - dictIterator *di = dictGetIterator(c->pubsub_channels); + dictIterator *di = dictGetSafeIterator(c->pubsub_channels); dictEntry *de; int count = 0; @@ -262,7 +262,7 @@ void punsubscribeCommand(redisClient *c) { } void publishCommand(redisClient *c) { - c->argv[2] = tryObjectEncoding(c->argv[2]); int receivers = pubsubPublishMessage(c->argv[1],c->argv[2]); + if (server.cluster_enabled) clusterPropagatePublish(c->argv[1],c->argv[2]); addReplyLongLong(c,receivers); }