summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
authorMeir Shpilraien (Spielrein) <meir@redislabs.com>2021-07-11 21:26:20 +0300
committerGitHub <noreply@github.com>2021-07-11 11:26:20 -0700
commitf5f31ff9b92b6bdf628716449d0d0782ceb7704a (patch)
tree06488aa9aa14564e91a282aa5f83d546c87ee144 /hiredis.c
parent5850a8ecd2fb4ab39d80773e3017f02aff097ec4 (diff)
Added REDIS_NO_AUTO_FREE_REPLIES flag (#962)
When set hiredis will not automatically free replies in an async context, and the replies must be freed instead by the user. Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hiredis.c b/hiredis.c
index 5825174..9947b1e 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -804,6 +804,9 @@ redisContext *redisConnectWithOptions(const redisOptions *options) {
if (options->options & REDIS_OPT_NOAUTOFREE) {
c->flags |= REDIS_NO_AUTO_FREE;
}
+ if (options->options & REDIS_OPT_NOAUTOFREEREPLIES) {
+ c->flags |= REDIS_NO_AUTO_FREE_REPLIES;
+ }
/* Set any user supplied RESP3 PUSH handler or use freeReplyObject
* as a default unless specifically flagged that we don't want one. */