EMSI now responding to PINGs in the same session

This commit is contained in:
Deon George 2021-07-18 23:37:44 +10:00
parent 9dcfe6b17d
commit 5ad342fd56
2 changed files with 11 additions and 8 deletions

View File

@ -346,12 +346,6 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
} else { } else {
$this->node->optionSet(self::O_PWD); $this->node->optionSet(self::O_PWD);
Log::info(sprintf('%s: - Remote Authed [%d] AKAs',__METHOD__,$c)); Log::info(sprintf('%s: - Remote Authed [%d] AKAs',__METHOD__,$c));
// 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);
}
} }
/* Link codes */ /* Link codes */
@ -1154,7 +1148,8 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
{ {
Log::debug(sprintf('%s: + Start',__METHOD__)); Log::debug(sprintf('%s: + Start',__METHOD__));
$rc = (new Zmodem)->zmodem_receive($this->client,$zap,$this->recv); // @todo If the node is not defined in the DB node->address is NULL. Need to figure out how to handle those nodes.
$rc = (new Zmodem)->zmodem_receive($this->client,$zap,$this->recv,$this->node->address);
return ($rc == self::RCDO || $rc == self::ERROR); return ($rc == self::RCDO || $rc == self::ERROR);
} }
@ -1170,6 +1165,13 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
{ {
Log::debug(sprintf('%s: + Start [%d]',__METHOD__,$zap)); Log::debug(sprintf('%s: + Start [%d]',__METHOD__,$zap));
// See if there is anything to add to the outbound
// 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);
}
$z = new Zmodem; $z = new Zmodem;
if (! $z->zmodem_sendinit($this->client,$zap) && $this->send->total_count) if (! $z->zmodem_sendinit($this->client,$zap) && $this->send->total_count)

View File

@ -11,6 +11,7 @@ use App\Classes\File\{Receive,Send};
use App\Classes\Sock\{SocketClient,SocketException}; use App\Classes\Sock\{SocketClient,SocketException};
use App\Interfaces\CRC as CRCInterface; use App\Interfaces\CRC as CRCInterface;
use App\Interfaces\Zmodem as ZmodemInterface; use App\Interfaces\Zmodem as ZmodemInterface;
use App\Models\Address;
use App\Traits\CRC as CRCTrait; use App\Traits\CRC as CRCTrait;
final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
@ -274,7 +275,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
$rc = $this->zmodem_senddone(); $rc = $this->zmodem_senddone();
} else { } else {
$rc = $this->zmodem_receive($this->client,$proto,$this->recv); $rc = $this->zmodem_receive($this->client,$proto,$this->recv,$this->node->address);
} }
return $rc; return $rc;