Fix for messages originating from a point, where PATH: is empty
This commit is contained in:
parent
29cbc80982
commit
3e202e34d2
@ -686,7 +686,6 @@ class Message extends FTNBase
|
|||||||
|
|
||||||
// First find our kludge lines
|
// First find our kludge lines
|
||||||
$ptr_start = 0;
|
$ptr_start = 0;
|
||||||
$ptr_end = 0;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (substr($message,$ptr_start,1) === "\x01") {
|
while (substr($message,$ptr_start,1) === "\x01") {
|
||||||
@ -828,14 +827,17 @@ class Message extends FTNBase
|
|||||||
|
|
||||||
$m = [];
|
$m = [];
|
||||||
preg_match('/^([^\s]+:?)+\s+(.*)$/',$line,$m);
|
preg_match('/^([^\s]+:?)+\s+(.*)$/',$line,$m);
|
||||||
$o->kludges = [$m[1],$m[2]];
|
|
||||||
|
// Messages that originate from a point dont have anything in a PATH
|
||||||
|
if (count($m) === 2)
|
||||||
|
$o->kludges = [$m[1],$m[2]];
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error(sprintf('%s:! Error parsing message, now at offset [0x%02x] (%s)',
|
Log::error(sprintf('%s:! Error parsing message, now at offset [0x%02x] (%s)',
|
||||||
self::LOGKEY,
|
self::LOGKEY,
|
||||||
$ptr_start,
|
$ptr_start,
|
||||||
$e->getMessage()),['dump'=>hex_dump($message)]);
|
$e->getMessage()),['dump'=>hex_dump($message),'line'=>$e->getLine(),'file'=>$e->getFile()]);
|
||||||
|
|
||||||
throw new InvalidPacketException('Error parsing message');
|
throw new InvalidPacketException('Error parsing message');
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,13 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
|
|||||||
|
|
||||||
Log::info(sprintf('%s:- Packet [%s] is a [%s] packet',self::LOGKEY,$o->name,get_class($o)));
|
Log::info(sprintf('%s:- Packet [%s] is a [%s] packet',self::LOGKEY,$o->name,get_class($o)));
|
||||||
|
|
||||||
if ($o->fz && ($o->fd || $so)) {
|
if ($o->fz && $o->fd) {
|
||||||
|
$o->zone = Zone::where('zone_id',$o->fz)
|
||||||
|
->join('domains',['domains.id'=>'zones.domain_id'])
|
||||||
|
->where('name',$o->fd)
|
||||||
|
->single();
|
||||||
|
|
||||||
|
} elseif ($o->fz && $so) {
|
||||||
Log::alert(sprintf('%s:! No domain in the packet, work it out from the system [%d] for zone [%d]',self::LOGKEY,$so->name,$o->fz));
|
Log::alert(sprintf('%s:! No domain in the packet, work it out from the system [%d] for zone [%d]',self::LOGKEY,$so->name,$o->fz));
|
||||||
|
|
||||||
if (($x=$so->zones->where('zone_id',$o->fz)->unique('domain_id'))->count() === 1) {
|
if (($x=$so->zones->where('zone_id',$o->fz)->unique('domain_id'))->count() === 1) {
|
||||||
@ -163,7 +169,7 @@ abstract class Packet extends FTNBase implements \Iterator, \Countable
|
|||||||
->sole();
|
->sole();
|
||||||
|
|
||||||
} catch (ModelNotFoundException $e) {
|
} catch (ModelNotFoundException $e) {
|
||||||
throw new InvalidPacketException(sprintf('%s:! We couldnt work out the packet zone, and there isnt a default for[%d]',self::LOGKEY,$o->fz));
|
throw new InvalidPacketException(sprintf('%s:! We couldnt work out the packet zone, and there isnt a default for [%d]',self::LOGKEY,$o->fz));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user