sdbox-sync.c (dovecot-2.3.16) | : | sdbox-sync.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 269 | skipping to change at line 269 | |||
} | } | |||
} | } | |||
*ctx_r = ctx; | *ctx_r = ctx; | |||
return 0; | return 0; | |||
} | } | |||
int sdbox_sync_finish(struct sdbox_sync_context **_ctx, bool success) | int sdbox_sync_finish(struct sdbox_sync_context **_ctx, bool success) | |||
{ | { | |||
struct sdbox_sync_context *ctx = *_ctx; | struct sdbox_sync_context *ctx = *_ctx; | |||
struct mail_storage *storage = &ctx->mbox->storage->storage.storage; | ||||
int ret = success ? 0 : -1; | int ret = success ? 0 : -1; | |||
*_ctx = NULL; | *_ctx = NULL; | |||
if (success) { | if (success) { | |||
mail_index_view_ref(ctx->sync_view); | mail_index_view_ref(ctx->sync_view); | |||
if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) { | if (mail_index_sync_commit(&ctx->index_sync_ctx) < 0) { | |||
mailbox_set_index_error(&ctx->mbox->box); | mailbox_set_index_error(&ctx->mbox->box); | |||
ret = -1; | ret = -1; | |||
} else { | } else { | |||
dbox_sync_expunge_files(ctx); | dbox_sync_expunge_files(ctx); | |||
mail_index_view_close(&ctx->sync_view); | mail_index_view_close(&ctx->sync_view); | |||
} | } | |||
} else { | } else { | |||
mail_index_sync_rollback(&ctx->index_sync_ctx); | mail_index_sync_rollback(&ctx->index_sync_ctx); | |||
} | } | |||
if (storage->rebuild_list_index) | ||||
ret = mail_storage_list_index_rebuild_and_set_uncorrupted(storage | ||||
); | ||||
index_storage_expunging_deinit(&ctx->mbox->box); | index_storage_expunging_deinit(&ctx->mbox->box); | |||
array_free(&ctx->expunged_uids); | array_free(&ctx->expunged_uids); | |||
i_free(ctx); | i_free(ctx); | |||
return ret; | return ret; | |||
} | } | |||
int sdbox_sync(struct sdbox_mailbox *mbox, enum sdbox_sync_flags flags) | int sdbox_sync(struct sdbox_mailbox *mbox, enum sdbox_sync_flags flags) | |||
{ | { | |||
struct sdbox_sync_context *sync_ctx; | struct sdbox_sync_context *sync_ctx; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added |