changeset 19024:84b45106e143

dsync: Fixed running with tcp/tcps destination.
author Timo Sirainen <tss@iki.fi>
date Thu, 27 Aug 2015 15:46:23 +0200
parents d6df577504cf
children 5423ae859f15
files src/doveadm/doveadm-dsync.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-dsync.c	Thu Aug 27 15:28:21 2015 +0200
+++ b/src/doveadm/doveadm-dsync.c	Thu Aug 27 15:46:23 2015 +0200
@@ -626,14 +626,19 @@
 	brain = dsync_brain_master_init(user, ibc, ctx->sync_type,
 					brain_flags, &set);
 
-	if (ctx->run_type == DSYNC_RUN_TYPE_LOCAL) {
+	switch (ctx->run_type) {
+	case DSYNC_RUN_TYPE_LOCAL:
 		if (cmd_dsync_run_local(ctx, user, brain, ibc2,
 					&changes_during_sync, &mail_error) < 0)
 			ret = -1;
-	} else {
+		break;
+	case DSYNC_RUN_TYPE_CMD:
 		ctx->child_wait = child_wait_new_with_pid(ctx->remote_pid,
 			cmd_dsync_remote_exited, ctx);
+		/* fall through */
+	case DSYNC_RUN_TYPE_STREAM:
 		cmd_dsync_run_remote(user);
+		break;
 	}
 
 	if (ctx->state_input != NULL) {