More complete rework of packet parsing and packet generation with 29710c

This commit is contained in:
2024-05-19 23:28:45 +10:00
parent 46f52dd56d
commit f279d85b08
43 changed files with 412 additions and 291 deletions

View File

@@ -32,7 +32,7 @@ final class Mail extends Send
public function __get($key) {
switch ($key) {
case 'dbids':
return $this->f->messages->pluck('dbid');
return $this->f->messages->pluck('id');
case 'name':
return sprintf('%08x',timew($this->youngest()));
@@ -111,7 +111,7 @@ final class Mail extends Send
return TRUE;
}
public function youngest(): Carbon
private function youngest(): Carbon
{
return $this->f->messages->pluck('date')->sort()->last();
}

View File

@@ -128,13 +128,12 @@ class Receive extends Base
// If packet is greater than a size, lets queue it
if ($this->queue || ($this->receiving->size > config('fido.queue_size',0))) {
Log::info(sprintf('%s:- Packet [%s] will be sent to the queue for processing because its [%d] size, or queue forced',self::LOGKEY,$this->receiving->full_name,$this->receiving->size));
PacketProcess::dispatch($this->receiving,$this->ao->withoutRelations(),$rcvd_time);
PacketProcess::dispatch($this->receiving->rel_name,$this->ao->zone->domain,FALSE,$rcvd_time);
} else
PacketProcess::dispatchSync($this->receiving,$this->ao->withoutRelations(),$rcvd_time);
PacketProcess::dispatchSync($this->receiving->rel_name,$this->ao->zone->domain,TRUE,$rcvd_time);
} catch (\Exception $e) {
Log::error(sprintf('%s:! Got error dispatching packet [%s] (%d:%s-%s).',self::LOGKEY,$this->receiving->full_name,$e->getLine(),$e->getFile(),$e->getMessage()));
Log::error(sprintf('%s:! Got error dispatching packet [%s] (%d:%s-%s).',self::LOGKEY,$this->receiving->rel_name,$e->getLine(),$e->getFile(),$e->getMessage()));
}
break;

View File

@@ -249,11 +249,10 @@ class Send extends Base
* Add our mail to the send queue
*
* @param Address $ao
* @param bool $update
* @return bool
* @throws Exception
*/
public function mail(Address $ao,bool $update=TRUE): bool
public function mail(Address $ao): bool
{
$mail = FALSE;
@@ -265,7 +264,7 @@ class Send extends Base
}
// Netmail
if ($x=$ao->getNetmail($update)) {
if ($x=$ao->getNetmail()) {
Log::debug(sprintf('%s:- Netmail(s) added for sending to [%s]',self::LOGKEY,$ao->ftn));
$this->list->push(new Mail($x,self::T_NETMAIL));
@@ -273,7 +272,7 @@ class Send extends Base
}
// Echomail
if ($x=$ao->getEchomail($update)) {
if ($x=$ao->getEchomail()) {
Log::debug(sprintf('%s:- Echomail(s) added for sending to [%s]',self::LOGKEY,$ao->ftn));
$this->list->push(new Mail($x,self::T_ECHOMAIL));