]> granicus.if.org Git - neomutt/commit
Start fixing imap_read_headers() to account for MSN gaps. (see #3942)
authorKevin McCarthy <kevin@8t8.us>
Sun, 21 May 2017 01:52:16 +0000 (18:52 -0700)
committerRichard Russon <rich@flatcap.org>
Wed, 24 May 2017 00:35:34 +0000 (01:35 +0100)
commitc585a2a0e5a414c4d4f66f30801f57669a51d97c
treeedc943e3b278c25cff29a2d3d77c7647e82698b8
parentd6fbb9ae78a4d561d47630a794f5ba706a5efb2b
Start fixing imap_read_headers() to account for MSN gaps. (see #3942)

Change the parameters to pass MSN instead of index, to make a bit
simpler.

Change header cache evaluation to look at the largest MSN retrieved
instead of ctx->msgcount for the next fetch start point.  This still
depends on the assumption that MSNs are retrieved in ascending order,
which needs to be fixed.

Simplify the header cache inner loop termination and memory cleanup
logic.  Fix a memory leak if a hole in the header cache occured.

Fix the header retrieval logic to take into account MSN gaps in the
results.  Loop only as long as we get IMAP_CMD_CONTINUE instead of
over a fixed count.  Simplify the inner loop termination and memory
cleanup logic too.

Simplify the "new mail while fetching" logic by creating a third outer
loop to handle re-fetches.

Fix msg_fetch_header() to return -2 if msg_parse_fetch() encounters a
corrupt FETCH response.  Previously it would pass on the rc of
msg_parse_fetch(), meaning it would return -1 even though the response
was corrupt.
imap/command.c
imap/imap.c
imap/imap_private.h
imap/message.c