On Wed, Sep 20, 2017 at 01:14:47PM -0700, Kevin J. McCarthy wrote:
> On Wed, Sep 20, 2017 at 09:20:41PM +0200, Fabian Groffen wrote:
> > Now with 1.9.0 (having the same patch applied) I notice that the ctrl-c
> > trick doesn't work any more, and mutt stays "frozen" somewhat, usually
> > breaking sort of out of this situation by itself after a little while.
> > I've had a couple of times now where re-loading the mailbox afterwards
> > causes weird errors, like it fails to connect, then claims password was
> > incorrect (even though it uses the one from memory), usually another try
> > works, sometimes it doesn't.  When it fails, it sometimes looks like it
> > actually isn't making a connection at all, but just resuming on some
> > broken handle of some sort.
> 
> This is probably due to the new $imap_poll_timeout option, which is
> polling before it gets to the code where the other other patch takes
> place.
> 
> It sounds like the disconnect that happens in that case is not quite
> right.  I'll take a look and see if I can improve it.

I haven't had a chance to test this yet, but I believe the problem is
the socket wasn't being properly closed for the connection to the open
mailbox.

If you have a chance, would you try the attached patch out and let me
know how it works?  I should have more time this weekend to dig my
laptop out and test it myself, too.

Thank you.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
# HG changeset patch
# User Kevin McCarthy <[email protected]>
# Date 1505963248 25200
#      Wed Sep 20 20:07:28 2017 -0700
# Node ID 510467c2278dbc4fa14f4f39b47eff6b62354140
# Parent  dcd293c5e3c7f0659f7863ff1c6202f05b5ab112
[mq]: imap-poll-timeout-fix

diff --git a/imap/command.c b/imap/command.c
--- a/imap/command.c
+++ b/imap/command.c
@@ -459,16 +459,17 @@
 static void cmd_handle_fatal (IMAP_DATA* idata)
 {
   idata->status = IMAP_FATAL;
 
   if ((idata->state >= IMAP_SELECTED) &&
       (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;
   }
 
   if (idata->state < IMAP_SELECTED)
     imap_close_connection (idata);
 }

Attachment: signature.asc
Description: PGP signature

Reply via email to