]> granicus.if.org Git - mutt/commitdiff
More out-of-order FETCH fixes. This time I wrote a replay tool acting
authorBrendan Cully <brendan@kublai.com>
Thu, 10 Aug 2006 02:59:58 +0000 (02:59 +0000)
committerBrendan Cully <brendan@kublai.com>
Thu, 10 Aug 2006 02:59:58 +0000 (02:59 +0000)
as an IMAP server based on a .muttdebug0 file, and mutt handled
the out-of-order responses served by it.

imap/message.c

index 6c3425a37b4f8c1b2693d22ce899eb4e19d5ec75..e973f6434b9e78d12e397bafc4e9cf8d708b262e 100644 (file)
@@ -167,11 +167,6 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
        }
 
         idx = h.sid - 1;
-        if (idx != msgno)
-        {
-          dprint (1, (debugfile, "Ignoring out-of-order FETCH response\n"));
-          continue;
-        }
         sprintf(uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */
         uid_validity = (unsigned int*)mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen);
 
@@ -179,8 +174,6 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
         {
          ctx->hdrs[idx] = mutt_hcache_restore((unsigned char *) uid_validity, 0);
          ctx->hdrs[idx]->index = idx;
-         if (h.sid != ctx->msgcount + 1)
-           dprint (1, (debugfile, "imap_read_headers: msgcount and sequence ID are inconsistent"));
          /* messages which have not been expunged are ACTIVE (borrowed from mh 
           * folders) */
          ctx->hdrs[idx]->active = 1;
@@ -213,19 +206,13 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
         return -1;
       }
     }
-  
-    fetchlast = msgbegin;
+    /* could also look for first null header in case hcache is holey */
+    msgbegin = ctx->msgcount;
   }
 #endif /* USE_HCACHE */
 
   for (msgno = msgbegin; msgno <= msgend ; msgno++)
   {
-    if (ctx->hdrs[msgno])
-    {
-      msgbegin++;
-      continue;
-    }
-
     if (ReadInc && (msgno == msgbegin || ((msgno+1) % ReadInc == 0)))
       mutt_message (_("Fetching message headers... [%d/%d]"), msgno + 1,
         msgend + 1);