]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replicator: Don't try to reuse doveadm connections (and have them immediately fail)
authorTimo Sirainen <tss@iki.fi>
Thu, 31 Jan 2013 20:14:12 +0000 (22:14 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 31 Jan 2013 20:14:12 +0000 (22:14 +0200)
src/replication/replicator/doveadm-connection.c

index 1aabbb4d5342855da02cfac5976d583d3bf38673..56f3dd16fda78bb7eddf29eeffcb0df59948cbe5 100644 (file)
@@ -57,7 +57,13 @@ static void doveadm_callback(struct doveadm_connection *conn,
 
        conn->callback = NULL;
        conn->context = NULL;
+
+       /* make sure callback doesn't try to reuse this connection, since
+          we can't currently handle it */
+       i_assert(!conn->cmd_sent);
+       conn->cmd_sent = TRUE;
        callback(reply, state, context);
+       conn->cmd_sent = FALSE;
 }
 
 static void doveadm_close(struct doveadm_connection *conn)