summaryrefslogtreecommitdiff
path: root/hiredis.h
diff options
context:
space:
mode:
authorBjorn Svensson <bjorn.a.svensson@est.tech>2021-12-22 19:44:29 +0100
committerGitHub <noreply@github.com>2021-12-22 10:44:29 -0800
commit58aacdac65a04f611e2a659cd60ffa283b8bdf54 (patch)
tree40e2e95128f4952b1e511fcb7b2324a2532c05c1 /hiredis.h
parentd3384260e7e1726747bd78474e4b0874a4b0a236 (diff)
Handle array response in parallell with pubsub using RESP3 (#1014)
RESP3 allows sending commands in parallell with pubsub handling and these commands might get responded with a REDIS_REPLY_ARRAY. This conflicts with the pubsub response handling for RESP2 and results in a faulty state when using RESP3. Add functionality to keep track of PUSH/RESP3 support on the connection and only expect the message type REDIS_REPLY_PUSH as subscribe messages when once seen.
Diffstat (limited to 'hiredis.h')
-rw-r--r--hiredis.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hiredis.h b/hiredis.h
index a093abe..7dd44ee 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -80,6 +80,9 @@ typedef long long ssize_t;
/* Flag that is set when we should set SO_REUSEADDR before calling bind() */
#define REDIS_REUSEADDR 0x80
+/* Flag that is set when the async connection supports push replies. */
+#define REDIS_SUPPORTS_PUSH 0x100
+
/**
* Flag that indicates the user does not want the context to
* be automatically freed upon error