Leverage Redis and queue to handle large packets

This commit is contained in:
Deon George
2021-08-24 23:42:03 +10:00
parent 1398ecff2d
commit d86d90cdeb
6 changed files with 97 additions and 10 deletions

View File

@@ -106,7 +106,7 @@ class Message extends FTNBase
private array $dst; // Address the message is to
private Collection $path; // FTS-0004.001 The message PATH lines
private Collection $pathaddress; // Collection of Addresses after parsing seenby
private Collection $pathaddress; // Collection of Addresses after parsing seenby
private Collection $rogue_path; // Collection of FTNs in the Seen-by that are not defined
private Collection $seenby; // FTS-0004.001 The message SEEN-BY lines
private Collection $seenaddress; // Collection of Addresses after parsing seenby
@@ -553,6 +553,11 @@ class Message extends FTNBase
*/
private function parseAddresses(string $type,Collection $addresses,Collection &$rogue): Collection
{
static $aos = NULL;
if (! $aos)
$aos = collect();
$nodes = collect();
$net = NULL;
@@ -567,7 +572,11 @@ class Message extends FTNBase
};
$ftn = sprintf('%d:%d/%d',$this->fz,$net&0x7fff,$node&0x7fff);
$ao = Address::findFTN($ftn);
// @todo This should be enhanced to include the address at the time of the message.
if ($aos->has($ftn))
$ao = $aos->get($ftn);
else
$aos->put($ftn,$ao=(bool)Address::findFTN($ftn));
if (! $ao) {
Log::alert(sprintf('%s:! Undefined Node [%s] in %s.',self::LOGKEY,$ftn,$type));