Fix processing packets when we loop without reading
This commit is contained in:
parent
3ffb1c1fd6
commit
4e66990826
@ -893,6 +893,7 @@ class Message extends FTNBase
|
|||||||
} elseif ($this->zone) {
|
} elseif ($this->zone) {
|
||||||
$this->src = Address::parseFTN(sprintf('%d:%d/%d.%d@%s',$this->zone->zone_id,$this->fn,$this->ff,$this->fp,$this->zone->domain->name));
|
$this->src = Address::parseFTN(sprintf('%d:%d/%d.%d@%s',$this->zone->zone_id,$this->fn,$this->ff,$this->fp,$this->zone->domain->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse SEEN-BY
|
// Parse SEEN-BY
|
||||||
if ($this->seenby->count())
|
if ($this->seenby->count())
|
||||||
$this->seenaddress = $this->parseAddresses('seenby',$this->seenby,$this->rogue_seenby);
|
$this->seenaddress = $this->parseAddresses('seenby',$this->seenby,$this->rogue_seenby);
|
||||||
|
@ -175,7 +175,8 @@ class Packet extends FTNBase implements \Iterator, \Countable
|
|||||||
$last = '';
|
$last = '';
|
||||||
|
|
||||||
while ($buf_ptr || (! feof($f) && ($readbuf=fread($f,self::BLOCKSIZE)))) {
|
while ($buf_ptr || (! feof($f) && ($readbuf=fread($f,self::BLOCKSIZE)))) {
|
||||||
$read_ptr += strlen($readbuf);
|
if (! $buf_ptr)
|
||||||
|
$read_ptr += strlen($readbuf); // Could use ftell()
|
||||||
|
|
||||||
if (strlen($message) < self::PACKED_MSG_HEADER_LEN) {
|
if (strlen($message) < self::PACKED_MSG_HEADER_LEN) {
|
||||||
$addchars = self::PACKED_MSG_HEADER_LEN-strlen($message);
|
$addchars = self::PACKED_MSG_HEADER_LEN-strlen($message);
|
||||||
@ -207,7 +208,7 @@ class Packet extends FTNBase implements \Iterator, \Countable
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (($end=strpos($readbuf,"\x00\x02\x00",$buf_ptr)) === FALSE) {
|
if (($end=strpos($readbuf,"\x00\x02\x00",$buf_ptr)) === FALSE) {
|
||||||
// In case our packet break is at the end of the buffer
|
// Just in case our packet break is at the end of the buffer
|
||||||
$last = substr($readbuf,-2);
|
$last = substr($readbuf,-2);
|
||||||
|
|
||||||
if ((str_contains($last,"\x00")) && ($size-$read_ptr > 2)) {
|
if ((str_contains($last,"\x00")) && ($size-$read_ptr > 2)) {
|
||||||
|
@ -4,13 +4,12 @@ namespace App\Classes\FTN;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use League\Flysystem\UnableToWriteFile;
|
use League\Flysystem\UnableToWriteFile;
|
||||||
|
|
||||||
use App\Classes\FTN as FTNBase;
|
use App\Classes\FTN as FTNBase;
|
||||||
use App\Models\{Address, File, Filearea, Setup};
|
use App\Models\{Address,File,Filearea};
|
||||||
use App\Traits\EncodeUTF8;
|
use App\Traits\EncodeUTF8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,7 +21,7 @@ class Tic extends FTNBase
|
|||||||
{
|
{
|
||||||
use EncodeUTF8;
|
use EncodeUTF8;
|
||||||
|
|
||||||
private const LOGKEY = 'FM-';
|
private const LOGKEY = 'FT-';
|
||||||
|
|
||||||
private const cast_utf8 = [
|
private const cast_utf8 = [
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user