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

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