]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
sync fix
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Jun 2004 05:54:43 +0000 (08:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Jun 2004 05:54:43 +0000 (08:54 +0300)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-sync.c

index 54f4d0198427cfce770aff38f6e817fda75b23f3..adf2db320d239592b90edd6357b2a1975ddfe5e9 100644 (file)
@@ -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) {