From a28de70a0196275317642eb60f8387a2ee950330 Mon Sep 17 00:00:00 2001 From: valentinogeron Date: Fri, 19 Jun 2020 07:45:25 +0300 Subject: [PATCH] timeout option in redisConnectWithOptions should be on connect only (#829) When connecting with a timeout, we shouldn't also call `redisSetTimeout` which will implement a timeout for commands. See related issue #722 --- hiredis.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hiredis.c b/hiredis.c index 4487134..7eaa991 100644 --- a/hiredis.c +++ b/hiredis.c @@ -790,9 +790,7 @@ redisContext *redisConnectWithOptions(const redisOptions *options) { // Unknown type - FIXME - FREE return NULL; } - if (options->timeout != NULL && (c->flags & REDIS_BLOCK) && c->fd != REDIS_INVALID_FD) { - redisContextSetTimeout(c, *options->timeout); - } + return c; }