trynextip: don't store 'ai' on failed connects...
authorDaniel Stenberg <daniel@haxx.se>
Tue, 18 Mar 2014 07:56:13 +0000 (08:56 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Mar 2014 15:34:12 +0000 (16:34 +0100)
It leads to the "next family" tries starting from the wrong point and thus
fails!

Bug: http://curl.haxx.se/bug/view.cgi?id=1337
Reported-by: ricker
lib/connect.c

index 5a376c3..90283fe 100644 (file)
@@ -570,11 +570,11 @@ static CURLcode trynextip(struct connectdata *conn,
 
       if(ai) {
         rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]);
-        conn->tempaddr[tempindex] = ai;
         if(rc == CURLE_COULDNT_CONNECT) {
           ai = ai->ai_next;
           continue;
         }
+        conn->tempaddr[tempindex] = ai;
       }
       break;
     }