mirror of
https://github.com/fluencelabs/redis
synced 2025-06-16 02:31:20 +00:00
Does not allow commands other than Pub/Sub commands when there is at least one pattern
This commit is contained in:
3
redis.c
3
redis.c
@ -2304,7 +2304,8 @@ static int processCommand(redisClient *c) {
|
||||
}
|
||||
|
||||
/* Only allow SUBSCRIBE and UNSUBSCRIBE in the context of Pub/Sub */
|
||||
if (dictSize(c->pubsub_channels) > 0 &&
|
||||
if ((dictSize(c->pubsub_channels) > 0 || listLength(c->pubsub_patterns) > 0)
|
||||
&&
|
||||
cmd->proc != subscribeCommand && cmd->proc != unsubscribeCommand &&
|
||||
cmd->proc != psubscribeCommand && cmd->proc != punsubscribeCommand) {
|
||||
addReplySds(c,sdsnew("-ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / QUIT allowed in this context\r\n"));
|
||||
|
Reference in New Issue
Block a user