From e7d8b0c78aca328eae94f0db471d22b0fcf91c6c Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 30 Jun 2011 17:08:16 +0200 Subject: [PATCH] Aggregate protocol length going up the stack --- parser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/parser.c b/parser.c index f0ee8fc..59d6955 100644 --- a/parser.c +++ b/parser.c @@ -316,6 +316,12 @@ size_t redis_parser_execute(redis_parser_t *parser, redis_protocol_t **dst, cons cur->remaining--; break; } + + /* Aggregate plen for nested objects */ + if (stackidx > 0) { + stack[stackidx-1].plen += cur->plen; + } + stackidx--; }