imap/pop3/smtp: Speed up SSL connection initialization

Don't wait for the next callback call (usually 1 second) before
continuing with protocol specific connection initialization.
This commit is contained in:
Jiri Hruska
2013-09-10 20:40:11 +02:00
committed by Steve Holme
parent 2879ffacfa
commit 5c14a7f068
4 changed files with 16 additions and 9 deletions

View File

@@ -1704,11 +1704,13 @@ static CURLcode imap_multi_statemach(struct connectdata *conn, bool *done)
CURLcode result = CURLE_OK;
struct imap_conn *imapc = &conn->proto.imapc;
if((conn->handler->flags & PROTOPT_SSL) && !imapc->ssldone)
if((conn->handler->flags & PROTOPT_SSL) && !imapc->ssldone) {
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
else
result = Curl_pp_statemach(&imapc->pp, FALSE);
if(result || !imapc->ssldone)
return result;
}
result = Curl_pp_statemach(&imapc->pp, FALSE);
*done = (imapc->state == IMAP_STOP) ? TRUE : FALSE;
return result;