Reduce zmodem debugging
This commit is contained in:
parent
14349adeab
commit
e78b5975b0
@ -17,6 +17,9 @@ class Item
|
|||||||
{
|
{
|
||||||
private const LOGKEY = 'I--';
|
private const LOGKEY = 'I--';
|
||||||
|
|
||||||
|
// For deep debugging
|
||||||
|
protected bool $DEBUG = FALSE;
|
||||||
|
|
||||||
protected const IS_PKT = (1<<1);
|
protected const IS_PKT = (1<<1);
|
||||||
protected const IS_ARC = (1<<2);
|
protected const IS_ARC = (1<<2);
|
||||||
protected const IS_FILE = (1<<3);
|
protected const IS_FILE = (1<<3);
|
||||||
|
@ -273,7 +273,9 @@ final class Send extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->file_pos += strlen($data);
|
$this->file_pos += strlen($data);
|
||||||
Log::debug(sprintf('%s: - Read [%d] bytes, file pos now [%d]',self::LOGKEY,strlen($data),$this->file_pos));
|
|
||||||
|
if ($this->DEBUG)
|
||||||
|
Log::debug(sprintf('%s: - Read [%d] bytes, file pos now [%d]',self::LOGKEY,strlen($data),$this->file_pos));
|
||||||
|
|
||||||
if ($data === FALSE)
|
if ($data === FALSE)
|
||||||
throw new UnreadableFileEncountered('Error reading file: '.$this->sending->file_name);
|
throw new UnreadableFileEncountered('Error reading file: '.$this->sending->file_name);
|
||||||
|
@ -1986,7 +1986,8 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
|||||||
*/
|
*/
|
||||||
private function ls_zsenddata(string $data,int $frame): int
|
private function ls_zsenddata(string $data,int $frame): int
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('%s:+ ls_zsenddata [%d] (%d)',self::LOGKEY,strlen($data),$frame));
|
if ($this->DEBUG)
|
||||||
|
Log::debug(sprintf('%s:+ ls_zsenddata [%d] (%d)',self::LOGKEY,strlen($data),$frame));
|
||||||
|
|
||||||
if ($this->ls_Protocol&self::LSZ_OPTCRC32) {
|
if ($this->ls_Protocol&self::LSZ_OPTCRC32) {
|
||||||
if ($this->DEBUG)
|
if ($this->DEBUG)
|
||||||
@ -2235,7 +2236,9 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
|||||||
/* Ok, position ACK */
|
/* Ok, position ACK */
|
||||||
case self::ZACK:
|
case self::ZACK:
|
||||||
$this->ls_txLastACK = $this->ls_fetchlong($this->ls_rxHdr);
|
$this->ls_txLastACK = $this->ls_fetchlong($this->ls_rxHdr);
|
||||||
Log::debug(sprintf('%s: - ls_zsendfile ZACK',self::LOGKEY),['ls_rxHdr'=>$this->ls_rxHdr,'ls_txLastACK'=>$this->ls_txLastACK,'ls_rxHdr'=>$this->ls_rxHdr]);
|
|
||||||
|
if ($this->DEBUG)
|
||||||
|
Log::debug(sprintf('%s: - ls_zsendfile ZACK',self::LOGKEY),['ls_rxHdr'=>$this->ls_rxHdr,'ls_txLastACK'=>$this->ls_txLastACK,'ls_rxHdr'=>$this->ls_rxHdr]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -172,7 +172,9 @@ final class SocketClient {
|
|||||||
if ($this->DEBUG)
|
if ($this->DEBUG)
|
||||||
Log::debug(sprintf('%s: - Sending [%d]',self::LOGKEY,$restsize));
|
Log::debug(sprintf('%s: - Sending [%d]',self::LOGKEY,$restsize));
|
||||||
$rc = $this->send(substr($this->tx_buf,$tx_ptr,$restsize),0);
|
$rc = $this->send(substr($this->tx_buf,$tx_ptr,$restsize),0);
|
||||||
Log::debug(sprintf('%s: - Sent [%d] (%s)',self::LOGKEY,$rc,Str::limit($this->tx_buf,15)));
|
|
||||||
|
if ($this->DEBUG)
|
||||||
|
Log::debug(sprintf('%s: - Sent [%d] (%s)',self::LOGKEY,$rc,Str::limit($this->tx_buf,15)));
|
||||||
|
|
||||||
if ($rc == $restsize) {
|
if ($rc == $restsize) {
|
||||||
$this->tx_buf = '';
|
$this->tx_buf = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user