PFDEBUG ENCODING added.

This commit is contained in:
antirez 2014-04-14 19:35:00 +02:00
parent 54f0156e8c
commit dde8dff73f

View File

@ -1396,6 +1396,13 @@ void pfdebugCommand(redisClient *c) {
decoded = sdstrim(decoded," "); decoded = sdstrim(decoded," ");
addReplyBulkCBuffer(c,decoded,sdslen(decoded)); addReplyBulkCBuffer(c,decoded,sdslen(decoded));
sdsfree(decoded); sdsfree(decoded);
}
/* PFDEBUG ENCODING <key> */
else if (!strcasecmp(cmd,"encoding")) {
char *encodingstr[2] = {"dense","sparse"};
if (c->argc != 3) goto arityerr;
addReplyStatus(c,encodingstr[hdr->encoding]);
} else { } else {
addReplyErrorFormat(c,"Unknown PFDEBUG subcommand '%s'", cmd); addReplyErrorFormat(c,"Unknown PFDEBUG subcommand '%s'", cmd);
} }