conn->host->removed = FALSE;
director_host_ref(conn->host);
/* make sure we don't keep old sequence values across restarts */
- conn->host->last_seq = 0;
+ director_host_restarted(conn->host);
next_comm_attempt = conn->host->last_protocol_failure +
DIRECTOR_PROTOCOL_FAILURE_RETRY_SECS;
host->last_network_failure = 0;
if (host->last_seq != 0) {
/* it also may have been restarted, reset last_seq */
- host->last_seq = 0;
+ director_host_restarted(host);
forward = TRUE;
}
} else {
i_assert(!host->removed);
/* make sure we don't keep old sequence values across restarts */
- host->last_seq = 0;
+ director_host_restarted(host);
conn = director_connection_init_common(dir, fd);
conn->name = i_strdup_printf("%s/out", host->name);
i_free(host);
}
+void director_host_restarted(struct director_host *host)
+{
+ host->last_seq = 0;
+ host->last_sync_seq = 0;
+ host->last_sync_seq_counter = 0;
+ host->last_sync_timestamp = 0;
+}
+
struct director_host *
director_host_get(struct director *dir, const struct ip_addr *ip,
unsigned int port)
void director_host_ref(struct director_host *host);
void director_host_unref(struct director_host *host);
+void director_host_restarted(struct director_host *host);
+
struct director_host *
director_host_get(struct director *dir, const struct ip_addr *ip,
unsigned int port);