imap.c: Fixed unnecessary state change if starttls fails

The state machine should only be changed to IMAP_STARTTLS when the
STARTTLS command has been successfully sent to the server.
This commit is contained in:
Steve Holme 2013-01-27 10:41:10 +00:00
parent 73fae58132
commit 499e30c4bb
1 changed files with 2 additions and 1 deletions

View File

@ -601,7 +601,8 @@ static CURLcode imap_state_servergreet_resp(struct connectdata *conn,
to TLS connection now */
const char *str = getcmdid(conn);
result = imap_sendf(conn, str, "%s STARTTLS", str);
state(conn, IMAP_STARTTLS);
if(!result)
state(conn, IMAP_STARTTLS);
}
else
result = imap_state_capability(conn);