summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/hiredis/net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/hiredis/net.c b/contrib/hiredis/net.c
index 6aada0a6f..c208eb10d 100644
--- a/contrib/hiredis/net.c
+++ b/contrib/hiredis/net.c
@@ -367,6 +367,10 @@ addrretry:
goto error;
}
}
+ if (blocking && redisSetBlocking(c,1) != REDIS_OK)
+ goto error;
+ if (redisSetTcpNoDelay(c) != REDIS_OK)
+ goto error;
if (connect(s,p->ai_addr,p->ai_addrlen) == -1) {
if (errno == EHOSTUNREACH) {
redisContextCloseFd(c);
@@ -384,10 +388,6 @@ addrretry:
goto error;
}
}
- if (blocking && redisSetBlocking(c,1) != REDIS_OK)
- goto error;
- if (redisSetTcpNoDelay(c) != REDIS_OK)
- goto error;
c->flags |= REDIS_CONNECTED;
rv = REDIS_OK;