]> granicus.if.org Git - mutt/commitdiff
If STARTTLS fails to complete the SSL handshake, the error is not
authorBrendan Cully <brendan@kublai.com>
Mon, 16 Aug 2004 21:36:38 +0000 (21:36 +0000)
committerBrendan Cully <brendan@kublai.com>
Mon, 16 Aug 2004 21:36:38 +0000 (21:36 +0000)
propagated and mutt will attempt to log in anyway, probably causing an
infinite block on read. The attached patch closes the socket in this
case, and propagates the error properly.

imap/imap.c

index 0f558eb66ee7467b4c24f4dd1e43f9050f6a7288..2b5d754b0624ec8da3a9aeb4ea62cb71642c8187 100644 (file)
@@ -426,7 +426,7 @@ int imap_open_connection (IMAP_DATA* idata)
          {
            mutt_error (_("Could not negotiate TLS connection"));
            mutt_sleep (1);
-           goto bail;
+           goto err_close_conn;
          }
          else
          {
@@ -456,6 +456,7 @@ int imap_open_connection (IMAP_DATA* idata)
 
  err_close_conn:
   mutt_socket_close (idata->conn);
+  idata->state = IMAP_DISCONNECTED;
  bail:
   FREE (&idata->capstr);
   return -1;