Enable processing messages coming from a domain with multiple zones

This commit is contained in:
Deon George
2023-01-02 01:05:44 +11:00
parent c1ab14f2e6
commit 109beb4f4f
2 changed files with 7 additions and 22 deletions

View File

@@ -443,8 +443,6 @@ class Packet extends FTNBase implements \Iterator, \Countable
// If the from address doenst exist, we'll create a new entry
if ($msg->errors->messages()->has('to') && $msg->tzone) {
$e = NULL;
try {
// @todo Need to work out the correct region for the host_id
Address::unguard();
@@ -454,21 +452,16 @@ class Packet extends FTNBase implements \Iterator, \Countable
'host_id' => $msg->tn,
'node_id' => $msg->tf,
'point_id' => $msg->tp,
'active' => TRUE,
]);
Address::reguard();
} catch (\Exception $e) {
Log::error(sprintf('%s:! Error finding/creating TO address [%s] for message',self::LOGKEY,$msg->tboss),['error'=>$e->getMessage()]);
}
// This shouldnt happen
if ($e || $ao->exists) {
Log::error(sprintf('%s:! Unexpected error attempting to create TO address [%s]',self::LOGKEY,$msg->tboss));
$this->errors->push($msg);
return;
}
$ao->active = TRUE;
$ao->role = Address::NODE_UNKNOWN;
System::unguard();
@@ -486,8 +479,6 @@ class Packet extends FTNBase implements \Iterator, \Countable
}
if ($msg->errors->messages()->has('from') && $msg->tzone) {
$e = NULL;
try {
// @todo Need to work out the correct region for the host_id
Address::unguard();
@@ -497,21 +488,16 @@ class Packet extends FTNBase implements \Iterator, \Countable
'host_id' => $msg->fn,
'node_id' => $msg->ff,
'point_id' => $msg->fp,
'active'=> TRUE,
]);
Address::reguard();
} catch (\Exception $e) {
Log::error(sprintf('%s:! Error finding/creating FROM address [%s] for message',self::LOGKEY,$msg->fboss),['error'=>$e->getMessage()]);
}
// This shouldnt happen
if ($e || $ao->exists) {
Log::error(sprintf('%s:! Unexpected error attempting to create FROM address [%s]',self::LOGKEY,$msg->fboss));
$this->errors->push($msg);
return;
}
$ao->active = TRUE;
$ao->role = Address::NODE_UNKNOWN;
System::unguard();