email: Provided extra comments following recent pop3/imap fixes

Provided additional clarification about the logic of the authenticate()
functions following commit 6b6bdc83bd and b4270a9af1.
This commit is contained in:
Steve Holme
2013-02-04 23:51:36 +00:00
parent 7fd5f680ea
commit 022e67294e
3 changed files with 17 additions and 7 deletions

View File

@@ -519,7 +519,7 @@ static CURLcode imap_authenticate(struct connectdata *conn)
const char *mech = NULL;
imapstate authstate = IMAP_STOP;
/* Check supported authentication mechanisms by decreasing order of
/* Calculate the supported authentication mechanism by decreasing order of
security */
#ifndef CURL_DISABLE_CRYPTO_AUTH
if(imapc->authmechs & SASL_MECH_DIGEST_MD5) {
@@ -554,6 +554,7 @@ static CURLcode imap_authenticate(struct connectdata *conn)
}
if(mech) {
/* Perform SASL based authentication */
const char *str = getcmdid(conn);
result = imap_sendf(conn, str, "%s AUTHENTICATE %s", str, mech);
@@ -562,10 +563,12 @@ static CURLcode imap_authenticate(struct connectdata *conn)
state(conn, authstate);
}
else if(!imapc->login_disabled)
/* Perform clear text authentication */
result = imap_state_login(conn);
else {
/* Other mechanisms not supported */
infof(conn->data, "No known authentication mechanisms supported!\n");
result = CURLE_LOGIN_DENIED; /* Other mechanisms not supported */
result = CURLE_LOGIN_DENIED;
}
return result;