From 811fcccfc97ee6545f1b9d28ac0dd9ea93a81ab8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 1 Aug 2010 23:50:46 +0200 Subject: multi: fix FTPS connecting the data connection with OpenSSL 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 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/ssluse.c b/lib/ssluse.c index 1b4da33d4..08ce4ccc7 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -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))) -- cgit v1.2.3