Commit b5076547 authored by antirez's avatar antirez
Browse files

RESP3: Use new deferred len API in dict.c.

parent cdd10193
......@@ -539,7 +539,7 @@ void keysCommand(client *c) {
sds pattern = c->argv[1]->ptr;
int plen = sdslen(pattern), allkeys;
unsigned long numkeys = 0;
void *replylen = addDeferredMultiBulkLength(c);
void *replylen = addReplyDeferredLen(c);
di = dictGetSafeIterator(c->db->dict);
allkeys = (pattern[0] == '*' && pattern[1] == '\0');
......@@ -557,7 +557,7 @@ void keysCommand(client *c) {
}
}
dictReleaseIterator(di);
setDeferredMultiBulkLength(c,replylen,numkeys);
setDeferredArrayLen(c,replylen,numkeys);
}
/* This callback is used by scanGenericCommand in order to collect elements
......@@ -782,10 +782,10 @@ void scanGenericCommand(client *c, robj *o, unsigned long cursor) {
}
/* Step 4: Reply to the client. */
addReplyMultiBulkLen(c, 2);
addReplyArrayLen(c, 2);
addReplyBulkLongLong(c,cursor);
addReplyMultiBulkLen(c, listLength(keys));
addReplyArrayLen(c, listLength(keys));
while ((node = listFirst(keys)) != NULL) {
robj *kobj = listNodeValue(node);
addReplyBulk(c, kobj);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment