From: Brendan Cully Date: Mon, 16 Aug 2004 21:36:38 +0000 (+0000) Subject: If STARTTLS fails to complete the SSL handshake, the error is not X-Git-Tag: mutt-1-5-15-rel~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13fa4e8859ddbaade8354b977038dd4388e92bd2;p=mutt If STARTTLS fails to complete the SSL handshake, the error is not 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. --- diff --git a/imap/imap.c b/imap/imap.c index 0f558eb6..2b5d754b 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -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;