mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
RESP3: Fix addReplyBool() RESP2/3 output.
This commit is contained in:
parent
4e2dd54df0
commit
8042afb246
@ -551,7 +551,10 @@ NULL
|
|||||||
for (int j = 0; j < 3; j++) addReplyLongLong(c,j);
|
for (int j = 0; j < 3; j++) addReplyLongLong(c,j);
|
||||||
} else if (!strcasecmp(name,"map")) {
|
} else if (!strcasecmp(name,"map")) {
|
||||||
addReplyMapLen(c,3);
|
addReplyMapLen(c,3);
|
||||||
for (int j = 0; j < 3; j++) addReplyLongLong(c,j);
|
for (int j = 0; j < 3; j++) {
|
||||||
|
addReplyLongLong(c,j);
|
||||||
|
addReplyBool(c, j == 1);
|
||||||
|
}
|
||||||
} else if (!strcasecmp(name,"attrib")) {
|
} else if (!strcasecmp(name,"attrib")) {
|
||||||
addReplyAttributeLen(c,1);
|
addReplyAttributeLen(c,1);
|
||||||
addReplyBulkCString(c,"key-popularity");
|
addReplyBulkCString(c,"key-popularity");
|
||||||
|
@ -612,7 +612,7 @@ void addReplyNull(client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addReplyBool(client *c, int b) {
|
void addReplyBool(client *c, int b) {
|
||||||
if (c->resp == 3) {
|
if (c->resp == 2) {
|
||||||
addReply(c, b ? shared.cone : shared.czero);
|
addReply(c, b ? shared.cone : shared.czero);
|
||||||
} else {
|
} else {
|
||||||
addReplyString(c, b ? "#t\r\n" : "#f\r\n",4);
|
addReplyString(c, b ? "#t\r\n" : "#f\r\n",4);
|
||||||
|
Loading…
Reference in New Issue
Block a user