Implemented file sending during BINKP and EMSI sessions

This commit is contained in:
2023-06-22 17:36:22 +10:00
parent 58341db0fb
commit b1b86ca04a
14 changed files with 308 additions and 82 deletions

View File

@@ -752,6 +752,7 @@ final class Binkp extends BaseProtocol
foreach ($this->node->aka_remote_authed as $ao) {
Log::debug(sprintf('%s: - M_eob Checking for any new mail to [%s]',self::LOGKEY,$ao->ftn));
$this->send->mail($ao);
$this->send->files($ao);
}
if ($this->send->total_count)
@@ -920,7 +921,7 @@ final class Binkp extends BaseProtocol
{
// @todo Commit our mail transaction if the remote end confirmed receipt of the file.
if ($this->sessionGet(self::SE_SENDFILE)) {
Log::debug(sprintf('%s:Packet [%s] sent. (%s)',self::LOGKEY,$this->send->sendas,$this->send->name));
Log::debug(sprintf('%s:Packet/File [%s] sent. (%s)',self::LOGKEY,$this->send->sendas,$this->send->name));
$this->sessionClear(self::SE_SENDFILE);
$this->send->close(TRUE);
@@ -928,7 +929,7 @@ final class Binkp extends BaseProtocol
}
if ($this->sessionGet(self::SE_WAITGOT)) {
Log::debug(sprintf('%s:Packet [%s] sent. (%s)',self::LOGKEY,$this->send->sendas,$this->send->name));
Log::debug(sprintf('%s:Packet/File [%s] sent. (%s)',self::LOGKEY,$this->send->sendas,$this->send->name));
$this->sessionClear(self::SE_WAITGOT);
$this->send->close(TRUE);
@@ -1107,6 +1108,7 @@ final class Binkp extends BaseProtocol
if ($this->node->aka_authed)
foreach ($this->node->aka_remote_authed as $ao) {
$this->send->mail($ao);
$this->send->files($ao);
}
$this->msgs(self::BPM_NUL,sprintf('TRF %lu %lu',$this->send->mail_size,$this->send->file_size));
@@ -1191,6 +1193,7 @@ final class Binkp extends BaseProtocol
if ($this->node->aka_authed)
foreach ($this->node->aka_remote_authed as $ao) {
$this->send->mail($ao);
$this->send->files($ao);
}
$this->msgs(self::BPM_NUL,sprintf('TRF %lu %lu',$this->send->mail_size,$this->send->file_size));

View File

@@ -1186,12 +1186,21 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
// Add our mail to the queue if we have authenticated
if ($this->node->aka_authed)
foreach ($this->node->aka_remote_authed as $ao) {
// Send mail
while ($this->send->mail($ao)) {
$z = new Zmodem;
if (! $z->zmodem_sendinit($this->client,$zap) && $this->send->total_count)
$z->zmodem_sendfile($this->send);
}
// Send files
while ($this->send->files($ao)) {
$z = new Zmodem;
if (! $z->zmodem_sendinit($this->client,$zap) && $this->send->total_count)
$z->zmodem_sendfile($this->send);
}
}
Log::debug(sprintf('%s:- Finished sending',self::LOGKEY));