Fixed error message generation in PFDEBUG GETREG.

Bulk length for registers was emitted too early, so if there was a bug
the reply looked like a long array with just one element, blocking the
client as result.
This commit is contained in:
antirez 2014-04-14 10:25:19 +02:00
parent 82c31f750d
commit 1ee18db922

View File

@ -1246,12 +1246,13 @@ void pfdebugCommand(redisClient *c) {
if (!strcasecmp(cmd,"getreg")) {
if (c->argc != 3) goto arityerr;
addReplyMultiBulkLen(c,HLL_REGISTERS);
if (hllSparseToDense(o) == REDIS_ERR) {
addReplyError(c,"HLL sparse encoding is corrupted");
return;
}
hdr = o->ptr;
addReplyMultiBulkLen(c,HLL_REGISTERS);
for (j = 0; j < HLL_REGISTERS; j++) {
uint8_t val;