multi: fix FTPS connecting the data connection with OpenSSL

Commit 496002ea1c (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
This commit is contained in:
Daniel Stenberg
2010-08-01 23:50:46 +02:00
parent b552ca223e
commit 811fcccfc9

View File

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