aboutsummaryrefslogtreecommitdiff
path: root/lib/ssluse.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssluse.c')
-rw-r--r--lib/ssluse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index ce62605e8..01eba90db 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -2425,8 +2425,18 @@ 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.
+ */
retcode = ossl_connect_step2(conn, sockindex);
- if(retcode || (data->state.used_interface == Curl_if_multi))
+ if(retcode || (data->state.used_interface == Curl_if_multi &&
+ (ssl_connect_2 == connssl->connecting_state ||
+ ssl_connect_2_reading == connssl->connecting_state ||
+ ssl_connect_2_writing == connssl->connecting_state)))
return retcode;
} /* repeat step2 until all transactions are done. */