From: Steve Holme Date: Sun, 27 Jan 2013 10:44:21 +0000 (+0000) Subject: smtp.c: Fixed unnecessary state change if starttls fails X-Git-Tag: curl-7_29_0~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e5e720c1901b203fa6ef578ad137847796f71c8;p=curl smtp.c: Fixed unnecessary state change if starttls fails The state machine should only be changed to SMTP_STARTTLS when the STARTTLS command has been successfully sent to the server. --- diff --git a/lib/smtp.c b/lib/smtp.c index 2433a6447..6204de0e8 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -543,7 +543,8 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode, /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "STARTTLS"); - state(conn, SMTP_STARTTLS); + if(!result) + state(conn, SMTP_STARTTLS); } else result = smtp_authenticate(conn);