Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5002:82747a8b0b8b HEAD
Removed file offset caching from mail_cache_foreach(). It didn't work
correctly when cache file was just compressed, and caused "cache file
corrupted" errors.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 14 Jan 2007 05:17:07 +0200 |
parents | c0a9bab3fc32 |
children | 327d82f579a2 |
files | src/lib-index/mail-cache-lookup.c src/lib-index/mail-cache-private.h |
diffstat | 2 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-cache-lookup.c Sun Jan 14 04:48:15 2007 +0200 +++ b/src/lib-index/mail-cache-lookup.c Sun Jan 14 05:17:07 2007 +0200 @@ -191,16 +191,9 @@ if (MAIL_CACHE_IS_UNUSABLE(view->cache)) return 0; - if (view->cached_offset_seq == seq) - offset = view->cached_offset; - else { - if ((ret = mail_cache_lookup_offset(view->cache, view->view, - seq, &offset)) <= 0) - return ret; - - view->cached_offset_seq = seq; - view->cached_offset = offset; - } + if ((ret = mail_cache_lookup_offset(view->cache, view->view, + seq, &offset)) <= 0) + return ret; ret = 1; array_clear(&view->tmp_offsets);
--- a/src/lib-index/mail-cache-private.h Sun Jan 14 04:48:15 2007 +0200 +++ b/src/lib-index/mail-cache-private.h Sun Jan 14 05:17:07 2007 +0200 @@ -169,7 +169,6 @@ buffer_t *cached_exists_buf; uint8_t cached_exists_value; uint32_t cached_exists_seq; - uint32_t cached_offset, cached_offset_seq; }; typedef int mail_cache_foreach_callback_t(struct mail_cache_view *view,