last_network_failure wasn't set, which caused a failed outgoing connection
to immediately reconnect to it. This resulted in rapid logging of
connect() errors.
struct director_connection *conn = *_conn;
struct director *dir = conn->dir;
- if (conn->connected_time.tv_sec + DIRECTOR_SUCCESS_MIN_CONNECT_SECS > ioloop_time &&
+ if ((conn->connected_time.tv_sec == 0 ||
+ conn->connected_time.tv_sec + DIRECTOR_SUCCESS_MIN_CONNECT_SECS > ioloop_time) &&
conn->host != NULL) {
/* connection didn't exist for very long, assume it has a
network problem */