]> granicus.if.org Git - curl/commitdiff
multi: fix FTPS connecting the data connection with OpenSSL
authorDaniel Stenberg <daniel@haxx.se>
Sun, 1 Aug 2010 21:50:46 +0000 (23:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 1 Aug 2010 21:50:46 +0000 (23:50 +0200)
Commit 496002ea1cd76af7f (released in 7.20.1) broke FTPS when using the
multi interface and OpenSSL was used. The condition for the non-blocking
connect was incorrect.

Reported by: Georg Lippitsch
Bug: http://curl.haxx.se/mail/lib-2010-07/0270.html

lib/ssluse.c

index 1b4da33d4f6f607768693e7fb100756bf0e7a4a1..08ce4ccc77f3cc366a8770709a03592ace0a5f41 100644 (file)
@@ -2430,15 +2430,14 @@ ossl_connect_common(struct connectdata *conn,
       /* socket is readable or writable */
     }
 
-    /* Run transaction, and return to the caller if it failed or if
-     * this connection is part of a multi handle and this loop would
-     * execute again. This permits the owner of a multi handle to
-     * abort a connection attempt before step2 has completed while
-     * ensuring that a client using select() or epoll() will always
-     * have a valid fdset to wait on.
+    /* Run transaction, and return to the caller if it failed or if this
+     * connection is done nonblocking and this loop would execute again. This
+     * permits the owner of a multi handle to abort a connection attempt
+     * before step2 has completed while ensuring that a client using select()
+     * or epoll() will always have a valid fdset to wait on.
      */
     retcode = ossl_connect_step2(conn, sockindex);
-    if(retcode || (data->state.used_interface == Curl_if_multi &&
+    if(retcode || (nonblocking &&
                    (ssl_connect_2 == connssl->connecting_state ||
                     ssl_connect_2_reading == connssl->connecting_state ||
                     ssl_connect_2_writing == connssl->connecting_state)))