X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/e2641e09cc0daf44f63f654230f72d22acf3a9af..0d916763afa44c2c6d5e28a4fe0f167197b00fc7:/src/pubsub.c diff --git a/src/pubsub.c b/src/pubsub.c index c9f5f310..728e559c 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -1,5 +1,9 @@ #include "redis.h" +/*----------------------------------------------------------------------------- + * Pubsub low level API + *----------------------------------------------------------------------------*/ + void freePubsubPattern(void *p) { pubsubPattern *pat = p; @@ -137,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; @@ -215,6 +219,10 @@ int pubsubPublishMessage(robj *channel, robj *message) { return receivers; } +/*----------------------------------------------------------------------------- + * Pubsub commands implementation + *----------------------------------------------------------------------------*/ + void subscribeCommand(redisClient *c) { int j;