aboutsummaryrefslogtreecommitdiff
path: root/lib/imap.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-02-14 19:41:42 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2011-02-20 21:11:12 +0100
commit45ca048f44f3c34441af225d9eae7605513db2c1 (patch)
treee131de6a3476eae10e81dd9c398d37f62107c181 /lib/imap.c
parentc4369f34b9b493cbed4e7bcafa77614e9d55055d (diff)
IMAP in multi mode: use Curl_ssl_connect_nonblocking() when connecting.
Diffstat (limited to 'lib/imap.c')
-rw-r--r--lib/imap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 5e294158b..4e71fb3ed 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -588,7 +588,14 @@ static CURLcode imap_multi_statemach(struct connectdata *conn,
bool *done)
{
struct imap_conn *imapc = &conn->proto.imapc;
- CURLcode result = Curl_pp_multi_statemach(&imapc->pp);
+ CURLcode result;
+
+ if((conn->protocol & PROT_IMAPS) && !imapc->ssldone) {
+ result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
+ }
+ else {
+ result = Curl_pp_multi_statemach(&imapc->pp);
+ }
*done = (bool)(imapc->state == IMAP_STOP);
@@ -700,7 +707,7 @@ static CURLcode imap_connect(struct connectdata *conn,
}
#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */
- if(conn->protocol & PROT_IMAPS) {
+ if((conn->protocol & PROT_IMAPS) && data->state.used_interface != Curl_if_multi) {
/* BLOCKING */
/* IMAPS is simply imap with SSL for the control channel */
/* now, perform the SSL initialization for this socket */