From acb6449d46087b02b94a3f61812d3fd46fe83335 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Fri, 22 Feb 2013 20:47:40 -0500 Subject: [PATCH] Default to NOT escape all on receieve --- mdl/m_protocol_zmodem.pas | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/mdl/m_protocol_zmodem.pas b/mdl/m_protocol_zmodem.pas index 219c87e..f72b891 100644 --- a/mdl/m_protocol_zmodem.pas +++ b/mdl/m_protocol_zmodem.pas @@ -199,7 +199,7 @@ Begin Status.Protocol := 'Zmodem'; LastSent := 0; - EscapeAll := True; + EscapeAll := False; Attn := ''; End; @@ -503,6 +503,7 @@ Begin End; *) +(* Procedure TProtocolZmodem.SendEscaped (B: SmallInt); Begin Case B of @@ -537,6 +538,42 @@ Begin Client.BufWriteChar(Char(LastSent)); End; +*) + +Procedure TProtocolZmodem.SendEscaped (B: SmallInt); +Begin + Case B of + DLE, + DLEHI, + XON, + XONHI, + XOFF, + XOFFHI, + ZDLE : Begin + Client.BufWriteChar(Char(ZDLE)); + LastSent := B XOR $40; + End; + 13, + 13 OR $80 : If (LastSent AND $7F = Ord('@')) Then Begin + Client.BufWriteChar(Char(ZDLE)); + LastSent := B XOR $40; + End Else + LastSent := B; + 255 : Begin + Client.BufWriteChar(Char(ZDLE)); + LastSent := ZRUB1; + End; + + Else + If (EscapeAll) and ((B AND $60) = 0) Then Begin + Client.BufWriteChar(Char(ZDLE)); + LastSent := B XOR $40; + End Else + LastSent := B; + End; + + Client.BufWriteChar(Char(LastSent)); +End; Procedure TProtocolZmodem.ZSendBinaryHeader (FrameType : Byte); Var