From: Timo Sirainen Date: Sat, 10 Jul 2010 14:57:37 +0000 (+0100) Subject: dsync: Added extra assert X-Git-Tag: 2.0.rc3~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91c943a598d88df607714321cc6f56b07abc0232;p=thirdparty%2Fdovecot%2Fcore.git dsync: Added extra assert --HG-- branch : HEAD --- diff --git a/src/dsync/dsync-worker-local.c b/src/dsync/dsync-worker-local.c index 3d95f7507a..0e24d54616 100644 --- a/src/dsync/dsync-worker-local.c +++ b/src/dsync/dsync-worker-local.c @@ -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;