]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Added extra sanity check.
authorTimo Sirainen <tss@iki.fi>
Tue, 23 Mar 2010 18:14:56 +0000 (20:14 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 23 Mar 2010 18:14:56 +0000 (20:14 +0200)
--HG--
branch : HEAD

src/dsync/dsync-brain.c

index 341c09b7a4e2dedcbb749c45d36268c675f6e3e0..adfdca6876be243f024885de8836f50de768f766 100644 (file)
@@ -572,6 +572,16 @@ static void dsync_brain_worker_finished(bool success, void *context)
 {
        struct dsync_brain *brain = context;
 
+       switch (brain->state) {
+       case DSYNC_STATE_SYNC_MSGS_FLUSH:
+       case DSYNC_STATE_SYNC_MSGS_FLUSH2:
+       case DSYNC_STATE_SYNC_FLUSH:
+       case DSYNC_STATE_SYNC_FLUSH2:
+               break;
+       default:
+               i_panic("dsync brain state=%d", brain->state);
+       }
+
        if (!success)
                dsync_brain_fail(brain);