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.
This commit is contained in:
antirez 2018-12-19 17:55:07 +01:00
parent eaaac08892
commit a4f8f4a824

View File

@ -2924,7 +2924,7 @@ void pingCommand(client *c) {
return; return;
} }
if (c->flags & CLIENT_PUBSUB) { if (c->flags & CLIENT_PUBSUB && c->resp == 2) {
addReply(c,shared.mbulkhdr[2]); addReply(c,shared.mbulkhdr[2]);
addReplyBulkCBuffer(c,"pong",4); addReplyBulkCBuffer(c,"pong",4);
if (c->argc == 1) if (c->argc == 1)