aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-01-27 10:41:10 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-01-27 10:41:10 +0000
commit499e30c4bb185b3a52414ef716543b329ba46a2e (patch)
tree6f25293a31f794ba103de37bcfadfb7fb53dadf5 /lib
parent73fae581323b617855d1187298c5bb8476ed1135 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 5e845fb35..4191f5722 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -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);