Logging updates
This commit is contained in:
@@ -484,8 +484,8 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
if (($rc=$this->ls_zinitsender(self::LSZ_WINDOW,'')) < 0)
|
||||
return $rc;
|
||||
|
||||
Log::debug(sprintf('%s: ZMODEM Link Options %d/%d, %s%s%s%s',
|
||||
__METHOD__,
|
||||
Log::debug(sprintf('%s: - ZMODEM Link Options %d/%d, %s%s%s%s',
|
||||
self::LOGKEY,
|
||||
$this->ls_MaxBlockSize,
|
||||
$this->ls_txWinSize,
|
||||
($this->ls_Protocol&self::LSZ_OPTCRC32) ? 'CRC32' : 'CRC16',
|
||||
@@ -1136,7 +1136,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
$incrc = crc16($data.chr($frametype));
|
||||
|
||||
if ($this->DEBUG)
|
||||
Log::debug(sprintf('%s: - ls_zrecvdata16 CRC%d got %08x - calculated %08x',self::LOGKEY,16,$incrc,$crc),['m'=>__METHOD__]);
|
||||
Log::debug(sprintf('%s: - ls_zrecvdata16 CRC%d got %08x - calculated %08x',self::LOGKEY,16,$incrc,$crc));
|
||||
|
||||
if ($incrc != $crc)
|
||||
return self::LSZ_BADCRC;
|
||||
@@ -2383,7 +2383,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
*/
|
||||
private function ls_zsendfinfo(Send $send,int $sernum,int $pos,int $fileleft,int $bytesleft): int
|
||||
{
|
||||
Log::debug(sprintf('%s: + Start [%s]',__METHOD__,$send->name));
|
||||
Log::debug(sprintf('%s:+ ls_zsendfinfo [%s]',self::LOGKEY,$send->name));
|
||||
|
||||
$trys = 0;
|
||||
$retransmit = 1;
|
||||
@@ -2466,7 +2466,6 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
$crc = $this->CRC32_UPDATE($c,$crc);
|
||||
|
||||
$crc = $this->CRC32_FINISH($crc);
|
||||
dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
if (($rc=$this->ls_zsendhhdr(self::ZCRC,$this->ls_storelong($crc))) < 0)
|
||||
return $rc;
|
||||
|
||||
@@ -2488,7 +2487,7 @@ dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
break;
|
||||
|
||||
default:
|
||||
Log::error(sprintf('%s: ? Something strange [%d]',__METHOD__,$rc));
|
||||
Log::error(sprintf('%s: ? Something strange [%d]',self::LOGKEY,$rc));
|
||||
|
||||
if ($rc < 0)
|
||||
return $rc;
|
||||
@@ -2496,7 +2495,7 @@ dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
|
||||
} while ($trys < 10);
|
||||
|
||||
Log::error(sprintf('%s: ? Something strange or timeout [%d]',__METHOD__,$rc));
|
||||
Log::error(sprintf('%s:? Something strange or timeout [%d]',self::LOGKEY,$rc));
|
||||
return $rc;
|
||||
}
|
||||
|
||||
@@ -2504,7 +2503,7 @@ dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
private function ls_zsendhhdr(int $frametype,array $hdr): int
|
||||
{
|
||||
if ($this->DEBUG)
|
||||
Log::debug(sprintf('%s: + Start',__METHOD__));
|
||||
Log::debug(sprintf('%s:+ ls_zsendhhdr',self::LOGKEY));
|
||||
|
||||
/* Send **<DLE> */
|
||||
$this->client->buffer_add(chr(self::ZPAD).chr(self::ZPAD).chr(self::ZDLE));
|
||||
@@ -2547,7 +2546,7 @@ dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
*/
|
||||
private function ls_zsendsinit(string $attstr): int
|
||||
{
|
||||
Log::debug(sprintf('%s: + Start [%s]',__METHOD__,$attrstr));
|
||||
Log::debug(sprintf('%s:+ ls_zsendsinit [%s]',self::LOGKEY,$attrstr));
|
||||
|
||||
$trys = 0;
|
||||
$retransmit = 1;
|
||||
@@ -2610,7 +2609,7 @@ dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
break;
|
||||
|
||||
default:
|
||||
Log::error(sprintf('%s: ? Something strange [%d]',__METHOD__,$rc));
|
||||
Log::error(sprintf('%s: ? Something strange [%d]',self::LOGKEY,$rc));
|
||||
|
||||
if ($rc < 0)
|
||||
return $rc;
|
||||
@@ -2618,7 +2617,7 @@ dump([__METHOD__,'crc'=>$crc,'crc32'=>crc32(file_get_contents($send->name))]);
|
||||
|
||||
} while ($trys < 10);
|
||||
|
||||
Log::error(sprintf('%s: ? Something strange or timeout [%d]',__METHOD__,$rc));
|
||||
Log::error(sprintf('%s:? Something strange or timeout [%d]',self::LOGKEY,$rc));
|
||||
return $rc;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user