Mercurial > dovecot > original-hg > dovecot-1.2
changeset 2148:219fe7776a0c HEAD
sync fix
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 16 Jun 2004 08:54:43 +0300 |
parents | 8a3e09139b4c |
children | b526decec0b8 |
files | src/lib-storage/index/mbox/mbox-sync.c |
diffstat | 1 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync.c Wed Jun 16 08:45:59 2004 +0300 +++ b/src/lib-storage/index/mbox/mbox-sync.c Wed Jun 16 08:54:43 2004 +0300 @@ -655,19 +655,21 @@ } 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 (buffer_get_used_size(sync_ctx->syncs) == 0) { + /* nothing to do */ + return 0; + } } - if (sync_ctx->sync_rec.uid1 == 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) {