RESP3: DEBUG PROTOCOL: fix strcasecmp() check.
This commit is contained in:
parent
795ad670f9
commit
4e2dd54df0
20
src/debug.c
20
src/debug.c
@ -533,26 +533,26 @@ NULL
|
|||||||
/* DEBUG PROTOCOL [string|integer|double|bignum|null|array|set|map|
|
/* DEBUG PROTOCOL [string|integer|double|bignum|null|array|set|map|
|
||||||
* attrib|push|verbatim|true|false|state|err|bloberr] */
|
* attrib|push|verbatim|true|false|state|err|bloberr] */
|
||||||
char *name = c->argv[2]->ptr;
|
char *name = c->argv[2]->ptr;
|
||||||
if (strcasecmp(name,"string")) {
|
if (!strcasecmp(name,"string")) {
|
||||||
addReplyBulkCString(c,"Hello World");
|
addReplyBulkCString(c,"Hello World");
|
||||||
} else if (strcasecmp(name,"integer")) {
|
} else if (!strcasecmp(name,"integer")) {
|
||||||
addReplyLongLong(c,12345);
|
addReplyLongLong(c,12345);
|
||||||
} else if (strcasecmp(name,"double")) {
|
} else if (!strcasecmp(name,"double")) {
|
||||||
addReplyDouble(c,3.14159265359);
|
addReplyDouble(c,3.14159265359);
|
||||||
} else if (strcasecmp(name,"bignum")) {
|
} else if (!strcasecmp(name,"bignum")) {
|
||||||
addReplyString(c,"(1234567999999999999999999999999999999\r\n",40);
|
addReplyString(c,"(1234567999999999999999999999999999999\r\n",40);
|
||||||
} else if (strcasecmp(name,"null")) {
|
} else if (!strcasecmp(name,"null")) {
|
||||||
addReplyNull(c);
|
addReplyNull(c);
|
||||||
} else if (strcasecmp(name,"array")) {
|
} else if (!strcasecmp(name,"array")) {
|
||||||
addReplyArrayLen(c,3);
|
addReplyArrayLen(c,3);
|
||||||
for (int j = 0; j < 3; j++) addReplyLongLong(c,j);
|
for (int j = 0; j < 3; j++) addReplyLongLong(c,j);
|
||||||
} else if (strcasecmp(name,"set")) {
|
} else if (!strcasecmp(name,"set")) {
|
||||||
addReplySetLen(c,3);
|
addReplySetLen(c,3);
|
||||||
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);
|
||||||
} else if (strcasecmp(name,"attrib")) {
|
} else if (!strcasecmp(name,"attrib")) {
|
||||||
addReplyAttributeLen(c,1);
|
addReplyAttributeLen(c,1);
|
||||||
addReplyBulkCString(c,"key-popularity");
|
addReplyBulkCString(c,"key-popularity");
|
||||||
addReplyArrayLen(c,2);
|
addReplyArrayLen(c,2);
|
||||||
@ -561,7 +561,7 @@ NULL
|
|||||||
/* Attributes are not real replies, so a well formed reply should
|
/* Attributes are not real replies, so a well formed reply should
|
||||||
* also have a normal reply type after the attribute. */
|
* also have a normal reply type after the attribute. */
|
||||||
addReplyBulkCString(c,"Some real reply following the attribute");
|
addReplyBulkCString(c,"Some real reply following the attribute");
|
||||||
} else if (strcasecmp(name,"push")) {
|
} else if (!strcasecmp(name,"push")) {
|
||||||
addReplyPushLen(c,2);
|
addReplyPushLen(c,2);
|
||||||
addReplyBulkCString(c,"server-cpu-usage");
|
addReplyBulkCString(c,"server-cpu-usage");
|
||||||
addReplyLongLong(c,42);
|
addReplyLongLong(c,42);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user