summaryrefslogtreecommitdiffstats
path: root/imap
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-05-01 09:26:48 -0700
committerKevin McCarthy <kevin@8t8.us>2020-05-01 12:25:20 -0700
commit48e5c70f95ccc49f569bf0bc4288dac962a201f0 (patch)
tree5418eadfddbe39035b3ad4627602c66f9c9357a6 /imap
parent67948d74b51fa4fb4f34c37d646531c031785792 (diff)
Ensure idata->reopen is clear when the mailbox is closed.
Commit ab457327 accidentally introduced a performance regression in the 1.13.0 release. The reason is that imap_sync_mailbox() was leaving IMAP_REOPEN_ALLOW set. When a mailbox was closed, and another opened, the imap_open_mailbox() would be processed with the reopen set. The initial connection and exec statements would trigger a imap_cmd_finish(). That would then prematurely trigger fetching new mail, with the newMailCount misset, which would in turn generate a tiny uid_hash. When the real download occurred, it would use the existing tiny hash, throttling performance. The regression commit removed what I thought was an unnecessary check, but it was guarding the fetch from happening at the wrong time during mailbox open too. The performance issue was already addressed by commit a8337951 in master, but I think it's good to wipe the entire state. The removes other possible strange behavior. A HUGE thanks to Guilhem Moulin for his help on this issue. Without all his work detailing the problem, creating automated testing, git bisecting, and logging, I would not have been able to find and fix the problem.
Diffstat (limited to 'imap')
-rw-r--r--imap/imap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/imap/imap.c b/imap/imap.c
index 86569426..63362176 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -1566,7 +1566,7 @@ int imap_close_mailbox (CONTEXT* ctx)
idata->state = IMAP_AUTHENTICATED;
}
- idata->reopen &= IMAP_REOPEN_ALLOW;
+ idata->reopen = 0;
FREE (&(idata->mailbox));
mutt_free_list (&idata->flags);
idata->ctx = NULL;