Transfering netmail via EMSI

This commit is contained in:
Deon George
2021-07-17 15:48:07 +10:00
parent 6ce4e64cb6
commit 1fa566b26c
15 changed files with 226 additions and 83 deletions

View File

@@ -500,29 +500,31 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
{
Log::debug(sprintf('%s: + Start',__METHOD__));
try {
$send->open();
$rc = $this->ls_zsendfile($send,$this->ls_SerialNum++,$send->total_count,$send->total_size);
while ($send->total_count && $send->open()) {
try {
$rc = $this->ls_zsendfile($send,$this->ls_SerialNum++,$send->total_count,$send->total_size);
switch ($rc) {
case self::LSZ_OK:
$send->close(TRUE);
switch ($rc) {
case self::LSZ_OK:
$send->close(TRUE);
break;
case self::ZSKIP:
case self::ZFERR:
$send->close(FALSE);
break;
case self::ZSKIP:
case self::ZFERR:
$send->close(FALSE);
break;
default:
$send->close(FALSE);
$this->ls_zabort();
break;
default:
$send->close(FALSE);
$this->ls_zabort();
break;
}
return $rc;
} catch (\Exception $e) {
Log::error(sprintf('%s: ! Error [%s]',__METHOD__,$e->getMessage()));
}
return $rc;
} catch (\Exception $e) {
Log::error(sprintf('%s: ! Error [%s]',__METHOD__,$e->getMessage()));
}
return self::OK;