aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-02-27 20:48:24 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-02-27 20:48:24 +0000
commit5b3736b5333f548069c8588f252ba88b0dd3294d (patch)
treed908d115f8722cfa894f2b6c0ff31490fcc738d6 /lib
parentcce08581ac51df51bc6c03a0f37375578b8aefd6 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 671f206d3..cfde0019a 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -810,23 +810,25 @@ static CURLcode imap_state_capability_resp(struct connectdata *conn,
line += wordlen;
}
}
- else if(imapcode != 'O')
- result = imap_state_login(conn);
- else if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) {
- /* We don't have a SSL/TLS connection yet, but SSL is requested */
- if(imapc->tls_supported)
- /* Switch to TLS connection now */
- result = imap_state_starttls(conn);
- else if(data->set.use_ssl == CURLUSESSL_TRY)
- /* Fallback and carry on with authentication */
- result = imap_authenticate(conn);
- else {
- failf(data, "STARTTLS not supported.");
- result = CURLE_USE_SSL_FAILED;
+ else if(imapcode == 'O') {
+ if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) {
+ /* We don't have a SSL/TLS connection yet, but SSL is requested */
+ if(imapc->tls_supported)
+ /* Switch to TLS connection now */
+ result = imap_state_starttls(conn);
+ else if(data->set.use_ssl == CURLUSESSL_TRY)
+ /* Fallback and carry on with authentication */
+ result = imap_authenticate(conn);
+ else {
+ failf(data, "STARTTLS not supported.");
+ result = CURLE_USE_SSL_FAILED;
+ }
}
+ else
+ result = imap_authenticate(conn);
}
else
- result = imap_authenticate(conn);
+ result = imap_state_login(conn);
return result;
}