IAC binary
This commit is contained in:
parent
e0d2b11b07
commit
6e7bcc3fe8
@ -944,20 +944,22 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
|||||||
// Peek for the next 2 chars
|
// Peek for the next 2 chars
|
||||||
do {
|
do {
|
||||||
$iac = $this->client->read(10,1,MSG_PEEK);
|
$iac = $this->client->read(10,1,MSG_PEEK);
|
||||||
Log::debug(sprintf('%s: - IAC LOOP',self::LOGKEY,['iac'=>ord($iac),'cmd'=>$iaccmd)]);
|
Log::debug(sprintf('%s: - IAC LOOP',self::LOGKEY),['iac'=>ord($iac),'cmd'=>$iaccmd]);
|
||||||
|
|
||||||
switch (ord($iac)) {
|
switch (ord($iac)) {
|
||||||
|
// Binary Mode
|
||||||
case 0x00:
|
case 0x00:
|
||||||
if ($iaccmd === 0xfb) {
|
if ($iaccmd === 0xfb) {
|
||||||
Log::debug(sprintf('%s: - IAC WILL BINARY [%02x]',self::LOGKEY,ord($iac)));
|
Log::debug(sprintf('%s: - IAC WILL BINARY [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
// Config with DO
|
// Config with DO
|
||||||
$this->client->send(chr(0xff).chr(0xfd).$iac);
|
$this->client->send(chr(0xff).chr(0xfd).$iac,10);
|
||||||
|
|
||||||
} elseif ($iaccmd === 0xfd) {
|
} elseif ($iaccmd === 0xfd) {
|
||||||
Log::debug(sprintf('%s: - IAC DO BINARY [%02x]',self::LOGKEY,ord($iac)));
|
Log::debug(sprintf('%s: - IAC DO BINARY [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
// Config with WILL
|
// Config with WILL
|
||||||
$this->client->send(chr(0xff).chr(0xfb).$iac);
|
$this->client->send(chr(0xff).chr(0xfb).$iac,10);
|
||||||
$this->client->iac_bin = true;
|
$this->client->iac_bin = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -970,12 +972,12 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
|||||||
Log::debug(sprintf('%s: - IAC WILL SUPPRESS-GO-AHEAD [%02x]',self::LOGKEY,ord($iac)));
|
Log::debug(sprintf('%s: - IAC WILL SUPPRESS-GO-AHEAD [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
// Config with DO
|
// Config with DO
|
||||||
$this->client->send(chr(0xff).chr(0xfd).$iac);
|
$this->client->send(chr(0xff).chr(0xfd).$iac,10);
|
||||||
} elseif ($iaccmd === 0xfd) {
|
} elseif ($iaccmd === 0xfd) {
|
||||||
Log::debug(sprintf('%s: - IAC DO SUPPRESS-GO-AHEAD [%02x]',self::LOGKEY,ord($iac)));
|
Log::debug(sprintf('%s: - IAC DO SUPPRESS-GO-AHEAD [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
// Config with WILL
|
// Config with WILL
|
||||||
$this->client->send(chr(0xff).chr(0xfb).$iac);
|
$this->client->send(chr(0xff).chr(0xfb).$iac,10);
|
||||||
$this->client->iac_bin = true;
|
$this->client->iac_bin = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -992,6 +994,11 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
|||||||
$iaccmd = ord($iac);
|
$iaccmd = ord($iac);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0xff:
|
||||||
|
Log::debug(sprintf('%s: - IAC [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
$iaccmd = ord($iac);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Log::debug(sprintf('%s: - IAC [%02x]',self::LOGKEY,ord($iac)));
|
Log::debug(sprintf('%s: - IAC [%02x]',self::LOGKEY,ord($iac)));
|
||||||
|
|
||||||
|
@ -436,6 +436,9 @@ final class SocketClient {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self::DEBUG)
|
||||||
|
Log::debug(sprintf('%s:- Buffer doesnt have [%d] chars, it only has [%d]',self::LOGKEY,$len,strlen($this->rx_buf)));
|
||||||
|
|
||||||
if ($timeout && (! $this->hasData($timeout)))
|
if ($timeout && (! $this->hasData($timeout)))
|
||||||
throw new SocketException(SocketException::SOCKET_TIMEOUT,$timeout);
|
throw new SocketException(SocketException::SOCKET_TIMEOUT,$timeout);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user