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);
}
#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 */
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;