Improve performance for ApiListener::SyncRelayMessage

refs #11014
This commit is contained in:
Gunnar Beutner 2016-01-27 08:43:20 +01:00
parent e7a1c83004
commit 0d5592a615
2 changed files with 4 additions and 5 deletions

View File

@ -636,13 +636,12 @@ void ApiListener::SyncRelayMessage(const MessageOrigin::Ptr& origin,
Zone::Ptr target_zone = endpoint->GetZone(); Zone::Ptr target_zone = endpoint->GetZone();
allZones.insert(target_zone);
/* only relay messages to zones which have access to the object */ /* only relay messages to zones which have access to the object */
if (!target_zone->CanAccessObject(secobj)) { if (!target_zone->CanAccessObject(secobj))
finishedLogZones.insert(target_zone);
continue; continue;
}
allZones.insert(target_zone);
/* don't relay messages to disconnected endpoints */ /* don't relay messages to disconnected endpoints */
if (!endpoint->GetConnected()) { if (!endpoint->GetConnected()) {

View File

@ -63,7 +63,7 @@ bool Zone::CanAccessObject(const ConfigObject::Ptr& object)
{ {
Zone::Ptr object_zone; Zone::Ptr object_zone;
if (dynamic_pointer_cast<Zone>(object)) if (object->GetReflectionType() == Zone::TypeInstance)
object_zone = static_pointer_cast<Zone>(object); object_zone = static_pointer_cast<Zone>(object);
else else
object_zone = static_pointer_cast<Zone>(object->GetZone()); object_zone = static_pointer_cast<Zone>(object->GetZone());