Remove some debugging left from previous commits, fix Address::scopeTrashed(), change display of BBS list

This commit is contained in:
Deon George 2023-07-07 22:42:02 +10:00
parent 6c75659395
commit 30c11956dd
3 changed files with 6 additions and 42 deletions

View File

@ -316,20 +316,15 @@ final class Binkp extends BaseProtocol
// CRAM-MD5 session
if ($this->setup->optionGet(self::F_MD,'binkp_options')) {
dump(['we want MD5']);
$this->capSet(self::F_MD,self::O_WANT);
if ($this->setup->optionGet(self::F_MDFORCE,'binkp_options')) {
dump(['no passwords']);
if ($this->setup->optionGet(self::F_MDFORCE,'binkp_options'))
$this->capSet(self::F_MD,self::O_NEED);
}
}
// Crypt Mode
if ($this->setup->optionGet(self::F_CRYPT,'binkp_options')) {
dump(['we want CRYPT']);
if ($this->setup->optionGet(self::F_CRYPT,'binkp_options'))
$this->capSet(self::F_CRYPT,self::O_WANT);
}
// Multibatch
if ($this->setup->optionGet(self::F_MULTIBATCH,'binkp_options'))
@ -391,9 +386,7 @@ final class Binkp extends BaseProtocol
return FALSE;
}
dump(['rx_buf'=>hex_dump($rx_buf)]);
$this->rx_buf .= ($this->capGet(self::F_CRYPT,self::O_YES)) ? $this->crypt_in->decrypt($rx_buf) : $rx_buf;
dump(['rx_buf'=>hex_dump($this->rx_buf)]);
}
if ($this->DEBUG)
@ -401,21 +394,13 @@ final class Binkp extends BaseProtocol
/* Received complete block */
if (strlen($this->rx_buf) === $blksz) {
dump(['A'=>$this->is_msg,'rx_size'=>$this->rx_size,'strlen'=>strlen($this->rx_buf)]);
/* Header */
if ($this->rx_size === -1 ) {
dump(['B'=>$this->is_msg]);
$this->is_msg = ord(substr($this->rx_buf,0,1)) >> 7;
// If compression is used, then this needs to be &0x3f, since the 2nd high bit is the compression flag
// @todo Need to see what happens, if we are receiving a block higher than 0x3fff. Possible?
$this->rx_size = ((ord(substr($this->rx_buf,0,1))&0x7f) << 8)+ord(substr($this->rx_buf,1,1));
dump([
'is_msg'=>$this->is_msg,
'alt-is_msg'=>Arr::get(unpack('C',substr($this->rx_buf,0,1)),1,0) >> 7,
'rx_size'=>$this->rx_size,
'alt-rx_size'=>Arr::get(unpack('n',substr($this->rx_buf,0,2)),1,0) & 0x7fff,
]);
Log::debug(sprintf('%s:- BINKP receive HEADER, is_msg [%d], rx_size [%d]',self::LOGKEY,$this->is_msg,$this->rx_size));
if ($this->rx_size === 0)
@ -508,10 +493,8 @@ final class Binkp extends BaseProtocol
}
} else {
dump('we need to write');
if ($this->recv->fd) {
try {
dump('write...');
$this->recv->write($this->rx_buf);
} catch (FileGrewException $e) {
@ -528,10 +511,7 @@ final class Binkp extends BaseProtocol
$rc = TRUE;
dump('write done...');
if ($this->recv->filepos === $this->recv->size) {
dump('all got...');
Log::info(sprintf('%s:- Finished receiving file [%s] with size [%d]',self::LOGKEY,$this->recv->name,$this->recv->size));
$this->msgs(self::BPM_GOTSKIP,$this->recv->name_size_time);
@ -544,11 +524,9 @@ final class Binkp extends BaseProtocol
}
}
dump('next...');
$this->rx_size = -1;
}
dump(['buf empty...'=> $rc]);
$this->rx_buf = '';
} else {
@ -891,16 +869,6 @@ final class Binkp extends BaseProtocol
return FALSE;
}
dump([
'name'=>$this->recv->name,
'file.name'=>Arr::get($file,'file.name'),
'mtime'=>$this->recv->mtime,
'file.mtime'=>Arr::get($file,'file.mtime'),
'size'=>$this->recv->size,
'file.size'=>Arr::get($file,'file.size'),
'filepos'=>$this->recv->filepos,
'offs'=>$file['offs'],
]);
// In NR mode, when we got -1 for the file offsite, the reply to our get will confirm our requested offset.
if ($this->recv->name && ! strncasecmp(Arr::get($file,'file.name'),$this->recv->name,self::MAX_PATH)
&& $this->recv->mtime === Arr::get($file,'file.mtime')
@ -908,7 +876,6 @@ final class Binkp extends BaseProtocol
&& $this->recv->filepos === $file['offs'])
{
$this->recv->open($this->node->address,$file['offs']<0,$file['flags']);
dump(['file opened']);
return TRUE;
}

View File

@ -75,9 +75,6 @@ class Address extends Model
public function scopeTrashed($query)
{
return $query->select($this->getTable().'.*')
->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
->orderBy('domains.name')
->withTrashed()
->FTNorder();
}

View File

@ -11,20 +11,19 @@
<p>Here is a list of systems that can be connected to.</p>
</div>
<div class="col-10 pt-2">
<div class="col-12 pt-2">
<table class="table monotable">
<thead>
<tr>
<th>System</th>
<th class="w-25">System</th>
<th class="w-50">Connection Details</th>
<th>FTN Networks</th>
<th>Connection Details</th>
</tr>
</thead>
<tbody>
@foreach (\App\Models\System::active()->whereNotNull('method')->orderBy('name')->with(['addresses.zone.domain'])->get() as $o)
<tr>
<td>{{ $o->name }}</td>
<td>{{ $o->addresses->pluck('zone.domain.name')->unique()->sort()->join(',') }}</td>
<td>
@switch($o->method)
@case(23)<a href="telnet://{{ $o->address }}:{{ $o->port }}">Telnet</a> [telnet://{{ $o->address }}:{{ $o->port }}]@break
@ -33,6 +32,7 @@
@default No details
@endswitch
</td>
<td>{{ $o->addresses->pluck('zone.domain.name')->unique()->sort()->join(', ') }}</td>
</tr>
@endforeach
</tbody>