From 21519d680b331811788f65806a8ff257eb9be6bf Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 31 Jan 2025 16:13:32 +1100 Subject: [PATCH] IAC binary --- app/Classes/Protocol/EMSI.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Classes/Protocol/EMSI.php b/app/Classes/Protocol/EMSI.php index b213d6d..336c16e 100644 --- a/app/Classes/Protocol/EMSI.php +++ b/app/Classes/Protocol/EMSI.php @@ -953,14 +953,16 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface Log::debug(sprintf('%s: - IAC WILL BINARY [%02x]',self::LOGKEY,ord($iac))); // Config with DO - $this->client->send(chr(0xff).chr(0xfd).$iac,10); + //$this->client->send(chr(0xff).chr(0xfd).$iac,10); } elseif ($iaccmd === 0xfd) { Log::debug(sprintf('%s: - IAC DO BINARY [%02x]',self::LOGKEY,ord($iac))); // Config with WILL - $this->client->send(chr(0xff).chr(0xfb).$iac,10); - $this->client->iac_bin = true; + if ($this->client->iac_bin) { + $this->client->send(chr(0xff).chr(0xfb).$iac,10); + $this->client->iac_bin = true; + } } $iaccmd = NULL; @@ -972,28 +974,31 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface Log::debug(sprintf('%s: - IAC WILL SUPPRESS-GO-AHEAD [%02x]',self::LOGKEY,ord($iac))); // Config with DO - $this->client->send(chr(0xff).chr(0xfd).$iac,10); + //$this->client->send(chr(0xff).chr(0xfd).$iac,10); + } elseif ($iaccmd === 0xfd) { Log::debug(sprintf('%s: - IAC DO SUPPRESS-GO-AHEAD [%02x]',self::LOGKEY,ord($iac))); // Config with WILL $this->client->send(chr(0xff).chr(0xfb).$iac,10); - $this->client->iac_bin = true; } $iaccmd = NULL; break; + // Will case 0xfb: Log::debug(sprintf('%s: - IAC WILL [%02x]',self::LOGKEY,ord($iac))); $iaccmd = ord($iac); break; + // Do case 0xfd: Log::debug(sprintf('%s: - IAC DO [%02x]',self::LOGKEY,ord($iac))); $iaccmd = ord($iac); break; + // IAC case 0xff: Log::debug(sprintf('%s: - IAC [%02x]',self::LOGKEY,ord($iac))); $iaccmd = ord($iac);