From 9018388c3f2d183f5110b57649d3239bd699291e Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 19 Dec 2018 17:56:50 +0100 Subject: [PATCH] RESP3: Allow any command in RESP3 Pub/Sub mode. --- src/server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index c5b66788..d85e10d9 100644 --- a/src/server.c +++ b/src/server.c @@ -2681,8 +2681,9 @@ int processCommand(client *c) { return C_OK; } - /* Only allow SUBSCRIBE and UNSUBSCRIBE in the context of Pub/Sub */ - if (c->flags & CLIENT_PUBSUB && + /* Only allow a subset of commands in the context of Pub/Sub if the + * connection is in RESP2 mode. With RESP3 there are no limits. */ + if ((c->flags & CLIENT_PUBSUB && c->resp == 2) && c->cmd->proc != pingCommand && c->cmd->proc != subscribeCommand && c->cmd->proc != unsubscribeCommand &&