summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
authorViktor Söderqvist <viktor.soderqvist@est.tech>2022-09-01 12:04:59 +0200
committerMichael Grunder <michael.grunder@gmail.com>2022-09-01 10:42:36 -0700
commit10c78c6e179a32b3e1f9cd99bf18dcf0c37d295e (patch)
tree36ea03abf4c9351a374e92a201c3c8cdc60788a3 /hiredis.c
parent1abe0c8285100e31a4688b3b09023eb3ad942394 (diff)
Add possibility to prefer IPv6, IPv4 or unspecified
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hiredis.c b/hiredis.c
index 6c48d66..c0968ed 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -814,6 +814,12 @@ redisContext *redisConnectWithOptions(const redisOptions *options) {
if (options->options & REDIS_OPT_NOAUTOFREEREPLIES) {
c->flags |= REDIS_NO_AUTO_FREE_REPLIES;
}
+ if (options->options & REDIS_OPT_PREFER_IPV4) {
+ c->flags |= REDIS_PREFER_IPV4;
+ }
+ if (options->options & REDIS_OPT_PREFER_IPV6) {
+ c->flags |= REDIS_PREFER_IPV6;
+ }
/* Set any user supplied RESP3 PUSH handler or use freeReplyObject
* as a default unless specifically flagged that we don't want one. */