]> granicus.if.org Git - icinga2/commitdiff
cluster: Fix idle timeout.
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 11 Sep 2013 07:18:15 +0000 (09:18 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 11 Sep 2013 07:18:15 +0000 (09:18 +0200)
components/cluster/clustercomponent.cpp
lib/base/tlsutility.cpp

index 9f2332a227f82806158157357073b66b7a6b3eeb..fc70b7fbc36d121a721a9b970da277a5e14cc7e4 100644 (file)
@@ -435,6 +435,9 @@ void ClusterComponent::NewClientHandler(const Socket::Ptr& client, TlsRole role)
 
        {
                ObjectLock olock(this);
+               Stream::Ptr oldClient = endpoint->GetClient();
+               if (oldClient)
+                       oldClient->Close();
                endpoint->SetClient(tlsStream);
                ReplayLog(endpoint, tlsStream);
        }
@@ -455,13 +458,15 @@ void ClusterComponent::ClusterTimerHandler(void)
 
        /* check if we've recently seen heartbeat messages from our peers */
        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;
 
                Stream::Ptr client = endpoint->GetClient();
 
-               if (client)
+               if (client) {
+                       Log(LogWarning, "cluster", "Closing connection for endpoiint '" + endpoint->GetName() + "' due to inactivity.");
                        client->Close();
+               }
        }
 
        Array::Ptr peers = GetPeers();
index 2d741725015c5eebed4522830af6a8d0e2c749ce..1c18a4694751e540c51b1d38c22f139edb975dc2 100644 (file)
@@ -35,8 +35,6 @@ static void InitializeOpenSSL(void)
        SSL_library_init();
        SSL_load_error_strings();
 
-       SSL_COMP_get_compression_methods();
-
        l_SSLInitialized = true;
 }