Get local endpoint if FromClient is not set and origin is local

This commit is contained in:
Mattia Codato 2020-06-30 13:47:13 +02:00
parent 22dc2f2393
commit e4e0115c9d
1 changed files with 6 additions and 1 deletions

View File

@ -77,7 +77,12 @@ void ClusterEvents::EnqueueCheck(const MessageOrigin::Ptr& origin, const Diction
void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params) {
Endpoint::Ptr sourceEndpoint = origin->FromClient->GetEndpoint();
Endpoint::Ptr sourceEndpoint;
if (origin->FromClient) {
sourceEndpoint = origin->FromClient->GetEndpoint();
} else if (origin->IsLocal()){
sourceEndpoint = Endpoint::GetLocalEndpoint();
}
if (!sourceEndpoint || (origin->FromZone && !Zone::GetLocalZone()->IsChildOf(origin->FromZone))) {
Log(LogNotice, "ClusterEvents")