From 83bba659b9dbd6c77baf2ff27ff6342317869a3e Mon Sep 17 00:00:00 2001 From: Michael Grunder Date: Thu, 21 May 2020 11:12:18 -0700 Subject: Add logic to handle RESP3 push messages (#819) Fixes #815 --- hiredis.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hiredis.c') diff --git a/hiredis.c b/hiredis.c index deb65a9..1c9e8ae 100644 --- a/hiredis.c +++ b/hiredis.c @@ -97,6 +97,7 @@ void freeReplyObject(void *reply) { case REDIS_REPLY_ARRAY: case REDIS_REPLY_MAP: case REDIS_REPLY_SET: + case REDIS_REPLY_PUSH: if (r->element != NULL) { for (j = 0; j < r->elements; j++) freeReplyObject(r->element[j]); @@ -155,7 +156,8 @@ static void *createStringObject(const redisReadTask *task, char *str, size_t len parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || - parent->type == REDIS_REPLY_SET); + parent->type == REDIS_REPLY_SET || + parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; } return r; @@ -201,7 +203,8 @@ static void *createIntegerObject(const redisReadTask *task, long long value) { parent = task->parent->obj; assert(parent->type == REDIS_REPLY_ARRAY || parent->type == REDIS_REPLY_MAP || - parent->type == REDIS_REPLY_SET); + parent->type == REDIS_REPLY_SET || + parent->type == REDIS_REPLY_PUSH); parent->element[task->idx] = r; } return r; -- cgit v1.2.3