diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-02-14 19:41:42 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-02-20 21:11:12 +0100 |
commit | 45ca048f44f3c34441af225d9eae7605513db2c1 (patch) | |
tree | e131de6a3476eae10e81dd9c398d37f62107c181 /lib | |
parent | c4369f34b9b493cbed4e7bcafa77614e9d55055d (diff) |
IMAP in multi mode: use Curl_ssl_connect_nonblocking() when connecting.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/imap.c | 11 | ||||
-rw-r--r-- | lib/imap.h | 1 |
2 files changed, 10 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 */ diff --git a/lib/imap.h b/lib/imap.h index 2f0b62a61..ab4cf2f09 100644 --- a/lib/imap.h +++ b/lib/imap.h @@ -47,6 +47,7 @@ struct imap_conn { imapstate state; /* always use imap.c:state() to change state! */ int cmdid; /* id number/index */ const char *idstr; /* pointer to a string for which to wait for as id */ + bool ssldone; /* is connect() over SSL done? only relevant in multi mode */ }; extern const struct Curl_handler Curl_handler_imap; |