dovecot-1.1: Cache file was never updated if the file existed bu...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 10 22:07:06 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/e7e209d77127
changeset: 7931:e7e209d77127
user: Timo Sirainen <tss at iki.fi>
date: Fri Oct 10 22:07:03 2008 +0300
description:
Cache file was never updated if the file existed but index didn't have cache extension.
diffstat:
1 file changed, 16 insertions(+), 12 deletions(-)
src/lib-index/mail-cache-transaction.c | 28 ++++++++++++++++------------
diffs (39 lines):
diff -r 589e85cab60c -r e7e209d77127 src/lib-index/mail-cache-transaction.c
--- a/src/lib-index/mail-cache-transaction.c Fri Oct 10 21:20:59 2008 +0300
+++ b/src/lib-index/mail-cache-transaction.c Fri Oct 10 22:07:03 2008 +0300
@@ -159,19 +159,23 @@ mail_cache_transaction_open_if_needed(st
return;
if (!mail_index_map_get_ext_idx(cache->index->map,
- cache->ext_id, &idx))
- return;
-
- ext = array_idx(&cache->index->map->extensions, idx);
- if (ext->reset_id == cache->hdr->file_seq || i == 2)
- break;
-
- /* index offsets don't match the cache file */
- if (ext->reset_id > cache->hdr->file_seq) {
- /* the cache file appears to be too old.
- reopening should help. */
- if (mail_cache_reopen(cache) != 0)
+ cache->ext_id, &idx)) {
+ /* index doesn't have a cache extension, but the cache
+ file exists (corrupted indexes fixed?). fix it. */
+ if (i == 2)
break;
+ } else {
+ ext = array_idx(&cache->index->map->extensions, idx);
+ if (ext->reset_id == cache->hdr->file_seq || i == 2)
+ break;
+
+ /* index offsets don't match the cache file */
+ if (ext->reset_id > cache->hdr->file_seq) {
+ /* the cache file appears to be too old.
+ reopening should help. */
+ if (mail_cache_reopen(cache) != 0)
+ break;
+ }
}
/* cache file sequence might be broken. it's also possible
More information about the dovecot-cvs
mailing list