From: Timo Sirainen Date: Tue, 21 Oct 2003 03:25:03 +0000 (+0300) Subject: compression could have broken header lists X-Git-Tag: 1.1.alpha1~4275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21d9c11f60624004a3bd9846afa5f755c8e254ba;p=thirdparty%2Fdovecot%2Fcore.git compression could have broken header lists --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index d1de10bd1b..e49742fa97 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -784,8 +784,15 @@ int mail_cache_compress(struct mail_cache *cache) if (!mmap_update(cache, 0, 0)) ret = FALSE; } - cache->index->header->flags &= ~(MAIL_INDEX_HDR_FLAG_REBUILD | - MAIL_INDEX_HDR_FLAG_COMPRESS_CACHE); + + /* headers could have changed, reread them */ + memset(cache->split_offsets, 0, sizeof(cache->split_offsets)); + + if (ret) { + cache->index->header->flags &= + ~(MAIL_INDEX_HDR_FLAG_REBUILD | + MAIL_INDEX_HDR_FLAG_COMPRESS_CACHE); + } if (!mail_cache_unlock(cache)) ret = FALSE;