From b510545d4daaabf9f954e5cfc117f2b849f5b2d2 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 12 Sep 2013 15:12:19 +0200 Subject: [PATCH] Fix delegation bug. --- components/cluster/clustercomponent.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/components/cluster/clustercomponent.cpp b/components/cluster/clustercomponent.cpp index 474f36fb6..97f8aeeae 100644 --- a/components/cluster/clustercomponent.cpp +++ b/components/cluster/clustercomponent.cpp @@ -467,6 +467,8 @@ void ClusterComponent::ClusterTimerHandler(void) message->Set("method", "cluster::HeartBeat"); message->Set("params", params); + Endpoint::GetByName(GetIdentity())->SetFeatures(features); + RelayMessage(Endpoint::Ptr(), message, false); { @@ -1128,10 +1130,6 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c Array::Ptr authorities = object->GetAuthorities(); std::vector endpoints; - if ((type == "checker" && SupportsChecks()) || - (type == "notification" && SupportsNotifications())) - endpoints.push_back(GetIdentity()); - BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects()) { bool match = false; @@ -1157,12 +1155,6 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c std::sort(endpoints.begin(), endpoints.end()); - std::ostringstream msgbuf; - BOOST_FOREACH(const String& name, endpoints) { - msgbuf << name << ", "; - } - Log(LogDebug, "cluster", "Responsible for " + object->GetName() + ": " + msgbuf.str()); - String key = object->GetType()->GetName() + "\t" + object->GetName(); unsigned long hash = Utility::SDBM(key); unsigned long index = hash % endpoints.size(); -- 2.40.0