mail-index-sync-update.c revision 31050c3df6cbe403e8ced8ef11b5c4e12124d354
5b99af0079813347d90c935ea540ed7f96dcea38Stéphane Graber/* Copyright (c) 2004-2007 Dovecot authors, see the included COPYING file */
d3928441889e4c91d986bbbb41e791e18d2b1e91S.Çağlar Onur/* If we have less than this many bytes to sync from log file, don't bother
d3928441889e4c91d986bbbb41e791e18d2b1e91S.Çağlar Onur reading the main index */
d3928441889e4c91d986bbbb41e791e18d2b1e91S.Çağlar Onur#define MAIL_INDEX_SYNC_MIN_READ_INDEX_SIZE 2048
d3928441889e4c91d986bbbb41e791e18d2b1e91S.Çağlar Onurmail_index_sync_update_log_offset(struct mail_index_sync_map_ctx *ctx,
f4e8a9186190660c3cc8b7bcc8c3a90165fba370Chris Glass mail_transaction_log_view_get_prev_pos(ctx->view->log_view,
6472dcc2c944a757f4f373f1cf1fc86b4369feeaStéphane Graber if (prev_offset == ctx->ext_intro_end_offset &&
6472dcc2c944a757f4f373f1cf1fc86b4369feeaStéphane Graber /* previous transaction was an extension introduction.
6472dcc2c944a757f4f373f1cf1fc86b4369feeaStéphane Graber we probably came here from
5b99af0079813347d90c935ea540ed7f96dcea38Stéphane Graber mail_index_sync_ext_reset(). if there are any more
f2a95ee1bf54c949614a68bf152ea9a8e1d3a172Stéphane Graber views which want to continue syncing it needs the
f2a95ee1bf54c949614a68bf152ea9a8e1d3a172Stéphane Graber intro. so back up a bit more.
f2a95ee1bf54c949614a68bf152ea9a8e1d3a172Stéphane Graber don't do this in case the last transaction in the
f2a95ee1bf54c949614a68bf152ea9a8e1d3a172Stéphane Graber log is the extension intro, so we don't keep trying
f2a95ee1bf54c949614a68bf152ea9a8e1d3a172Stéphane Graber to sync it over and over again. */
f2a95ee1bf54c949614a68bf152ea9a8e1d3a172Stéphane Graber i_assert(ctx->view->index->log->head->hdr.file_seq == prev_seq);
struct mail_index_map *
const char **error_r)
const char *error;
unsigned int i, count;
for (i = 0; i < count; i++) {
&error) < 0)
const char *error;
if (all) {
&error) < 0)
unsigned int i, count;
for (i = 0; i < count; i++) {
unsigned int i, count;
for (i = 0; i < count; i++, e++) {
FALSE);
void *dest;
/* we're not modifying any counted/lowwatered flags */
const void *data)
int ret = 0;
case MAIL_TRANSACTION_APPEND: {
if (ret <= 0)
case MAIL_TRANSACTION_EXPUNGE:
case MAIL_TRANSACTION_FLAG_UPDATE: {
if (ret <= 0)
case MAIL_TRANSACTION_HEADER_UPDATE: {
if (ret <= 0)
case MAIL_TRANSACTION_EXT_INTRO: {
if (ret <= 0)
case MAIL_TRANSACTION_EXT_RESET: {
case MAIL_TRANSACTION_EXT_HDR_UPDATE: {
if (ret <= 0)
case MAIL_TRANSACTION_EXT_REC_UPDATE: {
unsigned int i, record_size;
if (ret <= 0)
case MAIL_TRANSACTION_KEYWORD_UPDATE: {
case MAIL_TRANSACTION_KEYWORD_RESET: {
return ret;
#ifdef DEBUG
del++;
seen++;
const void *tdata;
int ret;
if (!force) {
if (ret <= 0) {
if (had_dirty) {
if (reset) {
&tdata)) > 0) {
if (had_dirty)
#ifdef DEBUG