Skip to content

Commit

Permalink
lib-index: Fix reset_id handling in mail_cache_get_missing_reason() c…
Browse files Browse the repository at this point in the history
…ache

Broken by bd897f8
  • Loading branch information
sirainen committed Jun 6, 2017
1 parent 01f1217 commit 52b52b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib-index/mail-cache-lookup.c
Expand Up @@ -634,12 +634,14 @@ mail_cache_get_highest_seq_with_cache(struct mail_cache_view *view,
for (; seq > highest_checked_seq; seq--) {
if (mail_cache_lookup_cur_offset(view->view, seq, reset_id_r) != 0) {
rc->highest_seq_with_cache = seq;
rc->reset_id = *reset_id_r;
return seq;
}
}
if (seq == 0)
return 0;
/* then return the result from cache */
*reset_id_r = rc->reset_id;
return rc->highest_seq_with_cache;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib-index/mail-cache-private.h
Expand Up @@ -173,6 +173,7 @@ struct mail_cache_missing_reason_cache {
uint32_t highest_checked_seq;
uint32_t highest_seq_with_cache;

uint32_t reset_id;
uint32_t log_file_head_seq;
uoff_t log_file_head_offset;
};
Expand Down

0 comments on commit 52b52b5

Please sign in to comment.