diff src/director/director-connection.c @ 13941:493ebb2cfc73

director: Added timeout to syncing to make sure we don't hang if it somehow gets lost.
author Timo Sirainen <tss@iki.fi>
date Tue, 17 Jan 2012 22:54:11 +0200
parents 9e43af01f147
children ba770cba5598
line wrap: on
line diff
--- a/src/director/director-connection.c	Tue Jan 17 22:21:57 2012 +0200
+++ b/src/director/director-connection.c	Tue Jan 17 22:54:11 2012 +0200
@@ -731,14 +731,8 @@
 	if (host != NULL)
 		director_connection_sync_host(conn, host, seq, line);
 
-	if (!dir->ring_synced && dir->left != NULL && dir->right != NULL &&
-	    (host == NULL || !host->self)) {
-		/* send a new SYNC in case the previous one got dropped */
-		director_connection_send(dir->right,
-			t_strdup_printf("SYNC\t%s\t%u\t%u\n",
-					net_ip2addr(&dir->self_ip),
-					dir->self_port, dir->sync_seq));
-	}
+	if (host == NULL || !host->self)
+		director_resend_sync(dir);
 	return TRUE;
 }