cluster: Fix idle timeout.

This commit is contained in:
Gunnar Beutner 2013-09-11 09:18:15 +02:00
parent 2e6f7d3cdb
commit 7fcde9eca8
2 changed files with 7 additions and 4 deletions

View File

@ -435,6 +435,9 @@ void ClusterComponent::NewClientHandler(const Socket::Ptr& client, TlsRole role)
{ {
ObjectLock olock(this); ObjectLock olock(this);
Stream::Ptr oldClient = endpoint->GetClient();
if (oldClient)
oldClient->Close();
endpoint->SetClient(tlsStream); endpoint->SetClient(tlsStream);
ReplayLog(endpoint, tlsStream); ReplayLog(endpoint, tlsStream);
} }
@ -455,13 +458,15 @@ void ClusterComponent::ClusterTimerHandler(void)
/* check if we've recently seen heartbeat messages from our peers */ /* check if we've recently seen heartbeat messages from our peers */
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) { BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 60) if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 300)
continue; continue;
Stream::Ptr client = endpoint->GetClient(); Stream::Ptr client = endpoint->GetClient();
if (client) if (client) {
Log(LogWarning, "cluster", "Closing connection for endpoiint '" + endpoint->GetName() + "' due to inactivity.");
client->Close(); client->Close();
}
} }
Array::Ptr peers = GetPeers(); Array::Ptr peers = GetPeers();

View File

@ -35,8 +35,6 @@ static void InitializeOpenSSL(void)
SSL_library_init(); SSL_library_init();
SSL_load_error_strings(); SSL_load_error_strings();
SSL_COMP_get_compression_methods();
l_SSLInitialized = true; l_SSLInitialized = true;
} }