changeset 16662:820f4dbaebdd

replicator: Fixed assert-crash if dsync server disconnected.
author Timo Sirainen <tss@iki.fi>
date Tue, 06 Aug 2013 12:48:15 +0300
parents b846a046d978
children ef5518ee5ab2
files src/replication/replicator/dsync-client.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/replication/replicator/dsync-client.c	Mon Aug 05 22:22:51 2013 +0300
+++ b/src/replication/replicator/dsync-client.c	Tue Aug 06 12:48:15 2013 +0300
@@ -68,6 +68,10 @@
 
 static void dsync_close(struct dsync_client *client)
 {
+	client->cmd_sent = FALSE;
+	client->handshaked = FALSE;
+	i_free_and_null(client->state);
+
 	if (client->fd == -1)
 		return;
 
@@ -77,9 +81,6 @@
 	if (close(client->fd) < 0)
 		i_error("close(dsync) failed: %m");
 	client->fd = -1;
-	i_free_and_null(client->state);
-	client->cmd_sent = FALSE;
-	client->handshaked = FALSE;
 }
 
 static void dsync_disconnect(struct dsync_client *client)