Commit c2e5be04 authored by antirez's avatar antirez
Browse files

RESP3: fix zrangeGenericCommand() proto dependent array len.

parent 8a0391fb
......@@ -2445,8 +2445,12 @@ void zrangeGenericCommand(client *c, int reverse) {
if (end >= llen) end = llen-1;
rangelen = (end-start)+1;
/* Return the result in form of a multi-bulk reply */
if (withscores && c->resp == 2) rangelen *= 2;
/* Return the result in form of a multi-bulk reply. RESP3 clients
* will receive sub arrays with score->element, while RESP2 returned
* a flat array. */
if (withscores && c->resp == 2)
addReplyArrayLen(c, rangelen*2);
else
addReplyArrayLen(c, rangelen);
if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
......
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