mail-index-transaction.c (dovecot-2.3.16) | : | mail-index-transaction.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 193 | skipping to change at line 193 | |||
*changes_r = 0; | *changes_r = 0; | |||
if ((t->flags & MAIL_INDEX_TRANSACTION_FLAG_EXTERNAL) != 0) | if ((t->flags & MAIL_INDEX_TRANSACTION_FLAG_EXTERNAL) != 0) | |||
trans_flags |= MAIL_TRANSACTION_EXTERNAL; | trans_flags |= MAIL_TRANSACTION_EXTERNAL; | |||
if ((t->flags & MAIL_INDEX_TRANSACTION_FLAG_SYNC) != 0) | if ((t->flags & MAIL_INDEX_TRANSACTION_FLAG_SYNC) != 0) | |||
trans_flags |= MAIL_TRANSACTION_SYNC; | trans_flags |= MAIL_TRANSACTION_SYNC; | |||
if (mail_transaction_log_append_begin(log->index, trans_flags, &ctx) < 0) | if (mail_transaction_log_append_begin(log->index, trans_flags, &ctx) < 0) | |||
return -1; | return -1; | |||
ret = mail_transaction_log_file_refresh(t, ctx); | ret = mail_transaction_log_file_refresh(t, ctx); | |||
#ifdef DEBUG | ||||
uint64_t expected_highest_modseq = | ||||
mail_index_transaction_get_highest_modseq(t); | ||||
#endif | ||||
if (ret > 0) T_BEGIN { | if (ret > 0) T_BEGIN { | |||
mail_index_transaction_finish(t); | mail_index_transaction_finish(t); | |||
mail_index_transaction_export(t, ctx, changes_r); | mail_index_transaction_export(t, ctx, changes_r); | |||
} T_END; | } T_END; | |||
mail_transaction_log_get_head(log, &log_seq1, &log_offset1); | mail_transaction_log_get_head(log, &log_seq1, &log_offset1); | |||
if (mail_transaction_log_append_commit(&ctx) < 0 || ret < 0) | if (mail_transaction_log_append_commit(&ctx) < 0 || ret < 0) | |||
return -1; | return -1; | |||
mail_transaction_log_get_head(log, &log_seq2, &log_offset2); | mail_transaction_log_get_head(log, &log_seq2, &log_offset2); | |||
i_assert(log_seq1 == log_seq2); | i_assert(log_seq1 == log_seq2); | |||
#ifdef DEBUG | ||||
i_assert(t->reset || | ||||
expected_highest_modseq == log->head->sync_highest_modseq); | ||||
#endif | ||||
if (t->reset) { | if (t->reset) { | |||
/* get rid of the old index. it might just confuse readers, | /* get rid of the old index. it might just confuse readers, | |||
especially if it's broken. */ | especially if it's broken. */ | |||
i_unlink_if_exists(log->index->filepath); | i_unlink_if_exists(log->index->filepath); | |||
} | } | |||
*commit_size_r = log_offset2 - log_offset1; | *commit_size_r = log_offset2 - log_offset1; | |||
if ((t->flags & MAIL_INDEX_TRANSACTION_FLAG_HIDE) != 0 && | if ((t->flags & MAIL_INDEX_TRANSACTION_FLAG_HIDE) != 0 && | |||
log_offset1 != log_offset2) { | log_offset1 != log_offset2) { | |||
End of changes. 2 change blocks. | ||||
9 lines changed or deleted | 0 lines changed or added |