Mercurial > dovecot > core-2.2
changeset 11738:0ffb55c4d323 HEAD
lib-index: Minor code cleanup / commenting.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 06 Jul 2010 13:57:52 +0100 |
parents | b9a5ad0324c8 |
children | c52acd672735 |
files | src/lib-index/mail-index-sync-update.c |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-update.c Tue Jul 06 13:44:48 2010 +0100 +++ b/src/lib-index/mail-index-sync-update.c Tue Jul 06 13:57:52 2010 +0100 @@ -283,19 +283,23 @@ { struct mail_index_transaction_commit_result *result = ctx->view->index->sync_commit_result; - uint32_t log_seq; - uoff_t log_offset, start_offset; + uint32_t prev_log_seq; + uoff_t prev_log_offset, trans_start_offset, trans_end_offset; if (result == NULL) return FALSE; + /* we'll return TRUE if this modseq change was written within the + transaction that was just committed */ mail_transaction_log_view_get_prev_pos(ctx->view->log_view, - &log_seq, &log_offset); - if (log_seq != result->log_file_seq) + &prev_log_seq, &prev_log_offset); + if (prev_log_seq != result->log_file_seq) return FALSE; - start_offset = result->log_file_offset - result->commit_size; - if (log_offset < start_offset || log_offset >= result->log_file_offset) + trans_end_offset = result->log_file_offset; + trans_start_offset = trans_end_offset - result->commit_size; + if (prev_log_offset < trans_start_offset || + prev_log_offset >= trans_end_offset) return FALSE; return TRUE;