mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
RESP3: fix zrangeGenericCommand() proto dependent array len.
This commit is contained in:
parent
8a0391fbc9
commit
c2e5be0421
@ -2445,8 +2445,12 @@ void zrangeGenericCommand(client *c, int reverse) {
|
|||||||
if (end >= llen) end = llen-1;
|
if (end >= llen) end = llen-1;
|
||||||
rangelen = (end-start)+1;
|
rangelen = (end-start)+1;
|
||||||
|
|
||||||
/* Return the result in form of a multi-bulk reply */
|
/* Return the result in form of a multi-bulk reply. RESP3 clients
|
||||||
if (withscores && c->resp == 2) rangelen *= 2;
|
* 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);
|
addReplyArrayLen(c, rangelen);
|
||||||
|
|
||||||
if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
|
if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
|
||||||
|
Loading…
Reference in New Issue
Block a user