Additional error checking
This commit is contained in:
parent
0bed7de8c2
commit
ae32939567
|
@ -906,6 +906,8 @@ Begin
|
||||||
FillChar (TxBuf, SizeOf(TxBuf), 0);
|
FillChar (TxBuf, SizeOf(TxBuf), 0);
|
||||||
|
|
||||||
TxHdr[ZF0] := ZCRESUM;
|
TxHdr[ZF0] := ZCRESUM;
|
||||||
|
// do we need to send more stuff here? maybe that is why syncterm is
|
||||||
|
// puking?
|
||||||
|
|
||||||
TmpStr := Status.FileName + #0 + strI2S(Status.FileSize);
|
TmpStr := Status.FileName + #0 + strI2S(Status.FileSize);
|
||||||
|
|
||||||
|
@ -956,6 +958,7 @@ Begin
|
||||||
Goto Start; //Continue;
|
Goto Start; //Continue;
|
||||||
End;
|
End;
|
||||||
(* is SYNCTERM really asking for the FREENCNT here????? WTF
|
(* is SYNCTERM really asking for the FREENCNT here????? WTF
|
||||||
|
looks like ZOC might too. something is wrong with what we expect here.
|
||||||
ZFREECNT: Begin
|
ZFREECNT: Begin
|
||||||
ZPutLong (LongInt($FFFFFFFF));
|
ZPutLong (LongInt($FFFFFFFF));
|
||||||
ZSendHexHeader (ZACK);
|
ZSendHexHeader (ZACK);
|
||||||
|
@ -1113,8 +1116,6 @@ Begin
|
||||||
TimeOut := TimerSet(500);
|
TimeOut := TimerSet(500);
|
||||||
|
|
||||||
While Not AbortTransfer And Not TimerUp(TimeOut) Do Begin
|
While Not AbortTransfer And Not TimerUp(TimeOut) Do Begin
|
||||||
// Client.PurgeInputData;
|
|
||||||
|
|
||||||
ZPutLong (0);
|
ZPutLong (0);
|
||||||
ZSendBinaryHeader (ZFIN);
|
ZSendBinaryHeader (ZFIN);
|
||||||
|
|
||||||
|
@ -1176,10 +1177,9 @@ Label
|
||||||
Var
|
Var
|
||||||
Tmp : SmallInt;
|
Tmp : SmallInt;
|
||||||
N : SmallInt;
|
N : SmallInt;
|
||||||
Errors : SmallInt;
|
|
||||||
Begin
|
Begin
|
||||||
UseCRC32 := True;
|
UseCRC32 := True;
|
||||||
Errors := 0;
|
Status.Errors := 0;
|
||||||
|
|
||||||
{$IFDEF ZDEBUG} ZLog('ZInitSender -> begin'); {$ENDIF}
|
{$IFDEF ZDEBUG} ZLog('ZInitSender -> begin'); {$ENDIF}
|
||||||
|
|
||||||
|
@ -1199,6 +1199,11 @@ Begin
|
||||||
|
|
||||||
Again:
|
Again:
|
||||||
|
|
||||||
|
If Status.Errors > 10 Then Begin
|
||||||
|
ZInitSender := ZERROR;
|
||||||
|
Exit;
|
||||||
|
End;
|
||||||
|
|
||||||
Tmp := ZGetHeader(RxHdr);
|
Tmp := ZGetHeader(RxHdr);
|
||||||
|
|
||||||
{$IFDEF ZDEBUG} ZLog('ZInitSender -> Got response ' + HeaderType(Tmp)); {$ENDIF}
|
{$IFDEF ZDEBUG} ZLog('ZInitSender -> Got response ' + HeaderType(Tmp)); {$ENDIF}
|
||||||
|
@ -1213,7 +1218,10 @@ Again:
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Inc (Status.Errors);
|
||||||
|
|
||||||
ZSendHexHeader (ZNAK);
|
ZSendHexHeader (ZNAK);
|
||||||
|
|
||||||
Goto Again;
|
Goto Again;
|
||||||
End;
|
End;
|
||||||
ZSINIT : Begin
|
ZSINIT : Begin
|
||||||
|
@ -1240,6 +1248,8 @@ Again:
|
||||||
{$IFDEF ZDEBUG} ZLog('ZInitSender -> EscapeAll:' + strI2S(Ord(EscapeAll))); {$ENDIF}
|
{$IFDEF ZDEBUG} ZLog('ZInitSender -> EscapeAll:' + strI2S(Ord(EscapeAll))); {$ENDIF}
|
||||||
{$IFDEF ZDEBUG} ZLog('ZInitSender -> BlockSize:' + strI2S(RxBufLen)); {$ENDIF}
|
{$IFDEF ZDEBUG} ZLog('ZInitSender -> BlockSize:' + strI2S(RxBufLen)); {$ENDIF}
|
||||||
*)
|
*)
|
||||||
|
Inc (Status.Errors);
|
||||||
|
|
||||||
Goto Again;
|
Goto Again;
|
||||||
End;
|
End;
|
||||||
ZFREECNT: Begin
|
ZFREECNT: Begin
|
||||||
|
@ -1254,8 +1264,8 @@ Again:
|
||||||
|
|
||||||
Repeat
|
Repeat
|
||||||
ZSendHexHeader (ZCOMPL);
|
ZSendHexHeader (ZCOMPL);
|
||||||
Inc (Errors);
|
Inc (Status.Errors);
|
||||||
Until (Errors >= 10) or (ZGetHeader(RxHdr) = ZFIN);
|
Until (Status.Errors >= 10) or (ZGetHeader(RxHdr) = ZFIN);
|
||||||
|
|
||||||
ZAckBiBi;
|
ZAckBiBi;
|
||||||
ZInitSender := ZCOMPL;
|
ZInitSender := ZCOMPL;
|
||||||
|
|
Loading…
Reference in New Issue