1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

imap: Reversed the logic of the (un)successful tagged CAPABILITY response

Reversed the logic of the unsuccessful vs successful tagged CAPABILITY
response in imap_state_capability_resp() to be more logical to read.
This commit is contained in:
Steve Holme 2013-02-27 20:48:24 +00:00
parent cce08581ac
commit 5b3736b533

View File

@ -810,23 +810,25 @@ static CURLcode imap_state_capability_resp(struct connectdata *conn,
line += wordlen; line += wordlen;
} }
} }
else if(imapcode != 'O') else if(imapcode == 'O') {
result = imap_state_login(conn); if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) {
else if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested */
/* We don't have a SSL/TLS connection yet, but SSL is requested */ if(imapc->tls_supported)
if(imapc->tls_supported) /* Switch to TLS connection now */
/* Switch to TLS connection now */ result = imap_state_starttls(conn);
result = imap_state_starttls(conn); else if(data->set.use_ssl == CURLUSESSL_TRY)
else if(data->set.use_ssl == CURLUSESSL_TRY) /* Fallback and carry on with authentication */
/* Fallback and carry on with authentication */ result = imap_authenticate(conn);
result = imap_authenticate(conn); else {
else { failf(data, "STARTTLS not supported.");
failf(data, "STARTTLS not supported."); result = CURLE_USE_SSL_FAILED;
result = CURLE_USE_SSL_FAILED; }
} }
else
result = imap_authenticate(conn);
} }
else else
result = imap_authenticate(conn); result = imap_state_login(conn);
return result; return result;
} }