]> granicus.if.org Git - neomutt/commitdiff
More fiddling with fatal state handling. Not tested, and probably as wrong
authorBrendan Cully <brendan@kublai.com>
Wed, 27 Jul 2005 00:40:15 +0000 (00:40 +0000)
committerBrendan Cully <brendan@kublai.com>
Wed, 27 Jul 2005 00:40:15 +0000 (00:40 +0000)
as what was already there.

imap/command.c

index 4055105e3300e42e4b260658b77f310810c2d0c4..74fa21a07c014acdb736e2c8509e94e390fc1bc6 100644 (file)
@@ -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;
   }