From a4f8f4a8246965c28a2ed3906a0567fbbfe09440 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 19 Dec 2018 17:55:07 +0100 Subject: [PATCH] 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. --- src/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index 8cdbdad7..c5b66788 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)