]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] "blocking mode" indeed should be set later 2524/head
authorMikhail Galanin <mgalanin@mimecast.com>
Mon, 24 Sep 2018 15:18:43 +0000 (16:18 +0100)
committerMikhail Galanin <mgalanin@mimecast.com>
Mon, 24 Sep 2018 15:18:43 +0000 (16:18 +0100)
contrib/hiredis/net.c

index c208eb10d85c684998e5c7cd506ab57a650859b2..97fd42c23cfc55f311152e6392ce50384c206f52 100644 (file)
@@ -367,8 +367,6 @@ 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) {
@@ -393,6 +391,8 @@ addrretry:
         rv = REDIS_OK;
         goto end;
     }
+    if (blocking && redisSetBlocking(c,1) != REDIS_OK)
+        goto error;
     if (p == NULL) {
         char buf[128];
         snprintf(buf,sizeof(buf),"Can't create socket: %s",strerror(errno));