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 // CRAM-MD5 session
if ($this->setup->optionGet(self::F_MD,'binkp_options')) { if ($this->setup->optionGet(self::F_MD,'binkp_options')) {
dump(['we want MD5']);
$this->capSet(self::F_MD,self::O_WANT); $this->capSet(self::F_MD,self::O_WANT);
if ($this->setup->optionGet(self::F_MDFORCE,'binkp_options')) { if ($this->setup->optionGet(self::F_MDFORCE,'binkp_options'))
dump(['no passwords']);
$this->capSet(self::F_MD,self::O_NEED); $this->capSet(self::F_MD,self::O_NEED);
}
} }
// Crypt Mode // Crypt Mode
if ($this->setup->optionGet(self::F_CRYPT,'binkp_options')) { if ($this->setup->optionGet(self::F_CRYPT,'binkp_options'))
dump(['we want CRYPT']);
$this->capSet(self::F_CRYPT,self::O_WANT); $this->capSet(self::F_CRYPT,self::O_WANT);
}
// Multibatch // Multibatch
if ($this->setup->optionGet(self::F_MULTIBATCH,'binkp_options')) if ($this->setup->optionGet(self::F_MULTIBATCH,'binkp_options'))
@ -391,9 +386,7 @@ final class Binkp extends BaseProtocol
return FALSE; 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; $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) if ($this->DEBUG)
@ -401,21 +394,13 @@ final class Binkp extends BaseProtocol
/* Received complete block */ /* Received complete block */
if (strlen($this->rx_buf) === $blksz) { if (strlen($this->rx_buf) === $blksz) {
dump(['A'=>$this->is_msg,'rx_size'=>$this->rx_size,'strlen'=>strlen($this->rx_buf)]);
/* Header */ /* Header */
if ($this->rx_size === -1 ) { if ($this->rx_size === -1 ) {
dump(['B'=>$this->is_msg]);
$this->is_msg = ord(substr($this->rx_buf,0,1)) >> 7; $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 // 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? // @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)); $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)); 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) if ($this->rx_size === 0)
@ -508,10 +493,8 @@ final class Binkp extends BaseProtocol
} }
} else { } else {
dump('we need to write');
if ($this->recv->fd) { if ($this->recv->fd) {
try { try {
dump('write...');
$this->recv->write($this->rx_buf); $this->recv->write($this->rx_buf);
} catch (FileGrewException $e) { } catch (FileGrewException $e) {
@ -528,10 +511,7 @@ final class Binkp extends BaseProtocol
$rc = TRUE; $rc = TRUE;
dump('write done...');
if ($this->recv->filepos === $this->recv->size) { 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)); 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); $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; $this->rx_size = -1;
} }
dump(['buf empty...'=> $rc]);
$this->rx_buf = ''; $this->rx_buf = '';
} else { } else {
@ -891,16 +869,6 @@ final class Binkp extends BaseProtocol
return FALSE; 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. // 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) if ($this->recv->name && ! strncasecmp(Arr::get($file,'file.name'),$this->recv->name,self::MAX_PATH)
&& $this->recv->mtime === Arr::get($file,'file.mtime') && $this->recv->mtime === Arr::get($file,'file.mtime')
@ -908,7 +876,6 @@ final class Binkp extends BaseProtocol
&& $this->recv->filepos === $file['offs']) && $this->recv->filepos === $file['offs'])
{ {
$this->recv->open($this->node->address,$file['offs']<0,$file['flags']); $this->recv->open($this->node->address,$file['offs']<0,$file['flags']);
dump(['file opened']);
return TRUE; return TRUE;
} }

View File

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

View File

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