New algorithm for calculating packet name, EMSI/BINKP inbound processing tested, Netmail rejection and intransit processing

This commit is contained in:
Deon George
2021-07-24 00:53:35 +10:00
parent 2fdc6eabad
commit ee30ef92c3
12 changed files with 184 additions and 54 deletions

View File

@@ -623,14 +623,6 @@ final class Binkp extends BaseProtocol
// @todo lock nodes
$this->node->ftn = $o;
// Add our mail to the queue if we have authenticated
if ($this->node->aka_authed)
foreach ($this->node->aka_remote as $ao) {
$this->send->mail($ao);
}
Log::info(sprintf('%s: = Node has [%lu] mail and [%lu] files - [%lu] items',__METHOD__,$this->send->mail_size,$this->send->file_size,$this->send->total_count));
$rc = $this->node->aka_num;
}
@@ -653,8 +645,6 @@ final class Binkp extends BaseProtocol
return 0;
}
$this->msgs(self::BPM_NUL,sprintf('TRF %lu %lu',$this->send->mail_size,$this->send->file_size));
if ($this->md_challenge) {
$this->msgs(self::BPM_PWD,sprintf('CRAM-MD5-%s',$this->node->get_md5chal($this->md_challenge)));
@@ -697,6 +687,8 @@ final class Binkp extends BaseProtocol
}
/**
* We received EOB from the remote.
*
* @throws Exception
*/
private function M_eob(string $buf): int
@@ -718,7 +710,7 @@ final class Binkp extends BaseProtocol
}
if ($this->send->total_count)
$this->sessionClear(self::SE_NOFILES);
$this->sessionClear(self::SE_NOFILES|self::SE_SENTEOB);
}
return 1;
@@ -1066,6 +1058,14 @@ final class Binkp extends BaseProtocol
}
}
// Add our mail to the queue if we have authenticated
if ($this->node->aka_authed)
foreach ($this->node->aka_remote as $ao) {
$this->send->mail($ao);
}
$this->msgs(self::BPM_NUL,sprintf('TRF %lu %lu',$this->send->mail_size,$this->send->file_size));
Log::debug(sprintf('%s: = End',__METHOD__));
return $this->binkp_hsdone();
}
@@ -1142,6 +1142,12 @@ final class Binkp extends BaseProtocol
if (strlen($tmp))
$this->msgs(self::BPM_NUL,sprintf('OPT%s',$tmp));
// Add our mail to the queue if we have authenticated
if ($this->node->aka_authed)
foreach ($this->node->aka_remote as $ao) {
$this->send->mail($ao);
}
$this->msgs(self::BPM_NUL,sprintf('TRF %lu %lu',$this->send->mail_size,$this->send->file_size));
$this->msgs(self::BPM_OK,sprintf('%ssecure',$have_pwd ? '' : 'non-'));
@@ -1235,7 +1241,7 @@ final class Binkp extends BaseProtocol
if ($rd && ! $this->binkp_recv())
break;
if (($this->mqueue->count() || $wd) && ! $this->binkp_send())
if (($this->mqueue->count() || $wd) && ! $this->binkp_send() && (! $this->send->total_count))
break;
}

View File

@@ -206,7 +206,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
if (! parent::onConnect($client)) {
$this->session(self::SESSION_ZMODEM,$client);
$this->client->close();
Log::info(sprintf('%s: = End - Connection closed [%s]',__METHOD__,$client->getAddress()));
Log::info(sprintf('%s: = End - Connection closed [%s]',__METHOD__,$client->address_remote));
}
return NULL;