]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Added extra assert
authorTimo Sirainen <tss@iki.fi>
Sat, 10 Jul 2010 14:57:37 +0000 (15:57 +0100)
committerTimo Sirainen <tss@iki.fi>
Sat, 10 Jul 2010 14:57:37 +0000 (15:57 +0100)
--HG--
branch : HEAD

src/dsync/dsync-worker-local.c

index 3d95f7507ad7cd33c53bfa568173698f8990dfe1..0e24d54616b5895932d5c6f9137c043efce2b7d8 100644 (file)
@@ -102,6 +102,7 @@ struct local_dsync_worker {
        void *finish_context;
 
        unsigned int reading_mail:1;
+       unsigned int finished:1;
 };
 
 extern struct dsync_worker_vfuncs local_dsync_worker;
@@ -1511,6 +1512,8 @@ static void dsync_worker_try_finish(struct local_dsync_worker *worker)
        if (worker->save_io != NULL || worker->reading_mail)
                return;
 
+       i_assert(!worker->finished);
+       worker->finished = TRUE;
        worker->finish_callback(!worker->worker.failed, worker->finish_context);
 }
 
@@ -1696,6 +1699,7 @@ local_worker_finish(struct dsync_worker *_worker,
        struct local_dsync_worker *worker =
                (struct local_dsync_worker *)_worker;
 
+       worker->finished = FALSE;
        worker->finish_callback = callback;
        worker->finish_context = context;