From: Brendan Cully Date: Wed, 27 Jul 2005 00:40:15 +0000 (+0000) Subject: More fiddling with fatal state handling. Not tested, and probably as wrong X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5aa14590a0ecebdad7fea739b3532e33e489929f;p=neomutt More fiddling with fatal state handling. Not tested, and probably as wrong as what was already there. --- diff --git a/imap/command.c b/imap/command.c index 4055105e3..74fa21a07 100644 --- a/imap/command.c +++ b/imap/command.c @@ -287,8 +287,7 @@ static void cmd_handle_fatal (IMAP_DATA* idata) idata->status = IMAP_FATAL; if ((idata->state == IMAP_SELECTED) && - (idata->reopen & IMAP_REOPEN_ALLOW) && - !idata->ctx->closing) + (idata->reopen & IMAP_REOPEN_ALLOW)) { mx_fastclose_mailbox (idata->ctx); mutt_error (_("Mailbox closed")); @@ -299,6 +298,7 @@ static void cmd_handle_fatal (IMAP_DATA* idata) if (idata->state != IMAP_SELECTED) { idata->state = IMAP_DISCONNECTED; + mutt_socket_close (idata->conn); idata->status = 0; } } @@ -376,11 +376,8 @@ static int cmd_handle_untagged (IMAP_DATA* idata) s += 3; SKIPWS (s); mutt_error ("%s", s); - idata->status = IMAP_BYE; - if (idata->state == IMAP_SELECTED) - mx_fastclose_mailbox (idata->ctx); - mutt_socket_close (idata->conn); - idata->state = IMAP_DISCONNECTED; + mutt_sleep (2); + cmd_handle_fatal (idata); return -1; }