return status;
}
- bool reconnect();
+ bool reconnect(bool initialAttempt = false);
void waitUntilConnected();
void hash();
void setId(const boost::uuids::uuid& newId);
}
}
-bool DownstreamState::reconnect()
+bool DownstreamState::reconnect(bool initialAttempt)
{
std::unique_lock<std::mutex> tl(connectLock, std::try_to_lock);
if (!tl.owns_lock() || isStopped()) {
connected = true;
}
catch (const std::runtime_error& error) {
- infolog("Error connecting to new server with address %s: %s", d_config.remote.toStringWithPort(), error.what());
+ if (initialAttempt || g_verbose) {
+ infolog("Error connecting to new server with address %s: %s", d_config.remote.toStringWithPort(), error.what());
+ }
connected = false;
break;
}
fd = -1;
}
- reconnect();
+ reconnect(true);
}
DownstreamState::~DownstreamState()