aboutsummaryrefslogtreecommitdiff
path: root/lib/pop3.c
diff options
context:
space:
mode:
authorJiri Hruska <jirka@fud.cz>2013-09-10 20:40:11 +0200
committerSteve Holme <steve_holme@hotmail.com>2013-09-10 19:47:54 +0100
commit5c14a7f06864f20a62b1fd1961d30f1902e2280a (patch)
tree077726f21df15b1dc42205c7b123e33805d24696 /lib/pop3.c
parent2879ffacfa0cf60a0e215d8b1300368390e7548f (diff)
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.
Diffstat (limited to 'lib/pop3.c')
-rw-r--r--lib/pop3.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index 5b49b1af7..f33b189d1 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -1368,11 +1368,13 @@ static CURLcode pop3_multi_statemach(struct connectdata *conn, bool *done)
CURLcode result = CURLE_OK;
struct pop3_conn *pop3c = &conn->proto.pop3c;
- if((conn->handler->flags & PROTOPT_SSL) && !pop3c->ssldone)
+ if((conn->handler->flags & PROTOPT_SSL) && !pop3c->ssldone) {
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone);
- else
- result = Curl_pp_statemach(&pop3c->pp, FALSE);
+ if(result || !pop3c->ssldone)
+ return result;
+ }
+ result = Curl_pp_statemach(&pop3c->pp, FALSE);
*done = (pop3c->state == POP3_STOP) ? TRUE : FALSE;
return result;