From: Timo Sirainen Date: Wed, 16 Jun 2004 05:54:43 +0000 (+0300) Subject: sync fix X-Git-Tag: 1.1.alpha1~3958 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1b7a02a05fbca580934c7312aae63ea9542aa79;p=thirdparty%2Fdovecot%2Fcore.git sync fix --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index 54f4d01984..adf2db320d 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -655,19 +655,21 @@ static int mbox_sync_loop(struct mbox_sync_context *sync_ctx, } else { /* we sync only what we need to. jump to first record that needs updating */ - if (sync_ctx->sync_rec.uid1 == 0) { + const struct mail_index_sync_rec *sync_rec; + + if (buffer_get_used_size(sync_ctx->syncs) == 0) { if (mbox_sync_read_index_syncs(sync_ctx, 1, &expunged) < 0) return -1; - } - if (sync_ctx->sync_rec.uid1 == 0) { - /* nothing to do */ - return 0; + if (buffer_get_used_size(sync_ctx->syncs) == 0) { + /* nothing to do */ + return 0; + } } - uid = sync_ctx->sync_rec.uid1; - if (mbox_sync_seek_to_uid(sync_ctx, uid) < 0) + sync_rec = buffer_get_data(sync_ctx->syncs, NULL); + if (mbox_sync_seek_to_uid(sync_ctx, sync_rec->uid1) < 0) return -1; if (sync_ctx->seq > 0) {