From: Brendan Cully Date: Thu, 12 Apr 2007 16:42:01 +0000 (-0700) Subject: Simplify IMAP message fetch loop slightly X-Git-Tag: mutt-1-5-16-rel~22^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab8c0253250ee5766c783800ca7187948d20a346;p=mutt Simplify IMAP message fetch loop slightly --- diff --git a/ChangeLog b/ChangeLog index 83fc4aab..9affe3c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-04-12 09:16 -0700 Brendan Cully (eb5db1cd5251) + + * imap/message.c: Handle a missing or corrupted header cache entry + (closes #2676) If imap_hcache_get fails, stop parsing the header + cache and simply refetch from that point on. + +2007-04-11 14:19 -0700 Paul Eggert (ac7355452a60) + + * configure.ac, muttbug.sh.in: Make mutt more posixly- + correct (closes #1615). + 2007-04-11 14:06 -0700 Brendan Cully (5393c104e08a) * mkchangelog.sh: Remove un-POSIX TZ NOOP in mkchangelog.sh (see diff --git a/imap/message.c b/imap/message.c index a7e2df14..77cef6ea 100644 --- a/imap/message.c +++ b/imap/message.c @@ -225,19 +225,11 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend) { mutt_progress_update (&progress, msgno + 1); + /* we may get notification of new mail while fetching headers */ if (msgno + 1 > fetchlast) { - fetchlast = msgno + 1; - while((fetchlast <= msgend) && (! ctx->hdrs[fetchlast])) - fetchlast++; - - /* - * Make one request for everything. This makes fetching headers an - * order of magnitude faster if you have a large mailbox. - * - * If we get more messages while doing this, we make another - * request for all the new messages. - */ + fetchlast = msgend + 1; + snprintf (buf, sizeof (buf), "FETCH %d:%d (UID FLAGS INTERNALDATE RFC822.SIZE %s)", msgno + 1, fetchlast, hdrreq);