summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-12-19 17:55:07 +0100
committerantirez <antirez@gmail.com>2019-01-09 17:00:30 +0100
commita4f8f4a8246965c28a2ed3906a0567fbbfe09440 (patch)
treed04c5f6b8b3b4572e181fee5222eb2b78cdd2d63
parenteaaac0889223406bef4e7ee34d75616ac6599b36 (diff)
downloadredis-a4f8f4a8246965c28a2ed3906a0567fbbfe09440.tar.gz
RESP3: PING should reply normally in RESP3 Pub/Sub mode.
Because in RESP3 commands can be sent in the Pub/Sub connection without problems, so it's better if in such mode there is no exception about PING.
-rw-r--r--src/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index 8cdbdad76..c5b667886 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2924,7 +2924,7 @@ void pingCommand(client *c) {
return;
}
- if (c->flags & CLIENT_PUBSUB) {
+ if (c->flags & CLIENT_PUBSUB && c->resp == 2) {
addReply(c,shared.mbulkhdr[2]);
addReplyBulkCBuffer(c,"pong",4);
if (c->argc == 1)