aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c8
-rw-r--r--lib/pop3.c8
-rw-r--r--lib/smtp.c8
3 files changed, 15 insertions, 9 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 17e9eb0b0..6a3b36449 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -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;
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;
diff --git a/lib/smtp.c b/lib/smtp.c
index 7ba2ba464..2d4055c24 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -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;