]> granicus.if.org Git - mutt/commitdiff
Close the imap socket for the selected mailbox on error.
authorKevin McCarthy <kevin@8t8.us>
Fri, 22 Sep 2017 18:12:25 +0000 (11:12 -0700)
committerKevin McCarthy <kevin@8t8.us>
Fri, 22 Sep 2017 18:12:25 +0000 (11:12 -0700)
The new $imap_poll_timeout calls the cmd_handle_fatal() error handler
on timeout, which is supposed to close and cleanup.

However, for the currently selected mailbox, the error handler was not
closing the socket after closing up the mailbox.  This left extra
SSL/GnuTLS data around and was causing errors on an attempt to
reconnect.

Thanks to Fabian Groffen for reporting the issue.

imap/command.c

index 891efb74c857d3b64a6f1eb4edac056f54c8d5b2..8529d9de70a9a99f37f30ba81c5428d518ffc77f 100644 (file)
@@ -464,6 +464,7 @@ static void cmd_handle_fatal (IMAP_DATA* idata)
       (idata->reopen & IMAP_REOPEN_ALLOW))
   {
     mx_fastclose_mailbox (idata->ctx);
+    mutt_socket_close (idata->conn);
     mutt_error (_("Mailbox closed"));
     mutt_sleep (1);
     idata->state = IMAP_DISCONNECTED;