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-Tag: mutt-1-5-10-rel~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b39f994eab2c7286fea32cc440b8948f6da8aa7;p=mutt 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 4055105e..74fa21a0 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; }