]> granicus.if.org Git - icinga2/commitdiff
Bugfixes.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 22 Jun 2012 11:40:09 +0000 (13:40 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 22 Jun 2012 11:40:09 +0000 (13:40 +0200)
base/application.cpp
components/delegation/delegationcomponent.cpp
icinga/endpointmanager.cpp
icinga/jsonrpcendpoint.cpp
icinga/jsonrpcendpoint.h

index c4e48d8de5703c01f36592b24ad55218dfa0dd48..8ecf9348a075539fc461c0ab325d42bbf55c3395 100644 (file)
@@ -296,7 +296,7 @@ void Application::Log(LogSeverity severity, const string& facility, const string
        char timestamp[100];
 
        // TODO: make this configurable
-       if (severity < LogInformation)
+       if (!IsDebugging() && severity < LogInformation)
                return;
 
        string severityStr;
index bc37909b86fad82d1a9b07aa4c51e33d5da9c4f9..da2c503932aef1ab1fa96cf6e067943e950474c6 100644 (file)
@@ -72,7 +72,7 @@ void DelegationComponent::AssignService(const Endpoint::Ptr& checker, const Serv
 void DelegationComponent::AssignServiceResponseHandler(Service& service, const Endpoint::Ptr& sender, bool timedOut)
 {
        /* ignore the message if it's not from the designated checker for this service */
-       if (!sender || service.GetChecker() != sender->GetIdentity())
+       if (sender && service.GetChecker() != sender->GetIdentity())
                return;
 
        if (timedOut) {
index 2f03990a4e9a0bc06c15967969eff8b44e4121f6..b4d5c912331f5231d3cd56c4b50761521179cef7 100644 (file)
@@ -227,6 +227,11 @@ void EndpointManager::SendAnycastMessage(Endpoint::Ptr sender,
        for (map<string, Endpoint::Ptr>::iterator i = m_Endpoints.begin(); i != m_Endpoints.end(); i++)
        {
                Endpoint::Ptr endpoint = i->second;
+
+               /* don't forward messages between non-local endpoints */
+               if (!sender->IsLocal() && !endpoint->IsLocal())
+                       continue;
+
                if (endpoint->HasSubscription(method))
                        candidates.push_back(endpoint);
        }
index 466ce3d8af1ba55526081daf910d8392f4a8bb7c..6aa1dbd6b345945f856e03d111598a1ad7a98530 100644 (file)
@@ -69,11 +69,6 @@ bool JsonRpcEndpoint::IsConnected(void) const
 void JsonRpcEndpoint::ProcessRequest(Endpoint::Ptr sender, const RequestMessage& message)
 {
        if (IsConnected()) {
-               string id;
-               if (message.GetID(&id))
-                       // TODO: remove calls after a certain timeout (and notify callers?)
-                       m_PendingCalls[id] = sender;
-
                m_Client->SendMessage(message);
        } else {
                // TODO: persist the event
@@ -116,8 +111,6 @@ void JsonRpcEndpoint::ClientClosedHandler(void)
 {
        Application::Log(LogWarning, "jsonrpc", "Lost connection to endpoint: identity=" + GetIdentity());
 
-       m_PendingCalls.clear();
-
        // TODO: _only_ clear non-persistent publications/subscriptions
        // unregister ourselves if no persistent publications/subscriptions are left (use a timer for that, once we have a TTL property for the topics)
        ClearSubscriptions();
index cc9f050c7301d4e64489773eb001da2f1f6225e2..852dadf86a231ec56b2b9a74a03f141aa174685e 100644 (file)
@@ -58,7 +58,6 @@ private:
        shared_ptr<SSL_CTX> m_SSLContext;
        string m_Address;
        JsonRpcClient::Ptr m_Client;
-       map<string, Endpoint::Ptr> m_PendingCalls;
 
        void SetAddress(string address);