]> granicus.if.org Git - curl/commitdiff
pop3.c: Fixed unnecessary state change if starttls fails
authorSteve Holme <steve_holme@hotmail.com>
Sun, 27 Jan 2013 10:42:32 +0000 (10:42 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 27 Jan 2013 10:42:32 +0000 (10:42 +0000)
The state machine should only be changed to POP3_STARTTLS when the
STLS command has been successfully sent to the server.

lib/pop3.c

index 9a9e81b20bef4b93d23f6d968b2923f2fe02ef44..18d16e0ff6651f40fe1d06b2c4763d7c90135904 100644 (file)
@@ -542,7 +542,8 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn,
     /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch
        to TLS connection now */
     result = Curl_pp_sendf(&pop3c->pp, "STLS");
-    state(conn, POP3_STARTTLS);
+    if(!result)
+      state(conn, POP3_STARTTLS);
   }
   else
     result = pop3_state_capa(conn);