From 80d964067a8f762e6dc6b43cec9acbbb7a1c856c Mon Sep 17 00:00:00 2001 From: Almindor Date: Wed, 8 Nov 2006 22:30:39 +0000 Subject: [PATCH] * fixes some telnet issues with TS_GA (go ahead) command git-svn-id: trunk@5293 - --- fcl/lnet/examples/ltelnet/ltclient.pp | 3 ++- fcl/lnet/lcontrolstack.pp | 15 +++++++-------- fcl/lnet/ltelnet.pp | 11 +++++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/fcl/lnet/examples/ltelnet/ltclient.pp b/fcl/lnet/examples/ltelnet/ltclient.pp index 1c67274767..5d36f46cd8 100644 --- a/fcl/lnet/examples/ltelnet/ltclient.pp +++ b/fcl/lnet/examples/ltelnet/ltclient.pp @@ -95,7 +95,8 @@ begin SendStr:=''; end else begin SendStr:=SendStr + c; - Write(c); + if not FCon.OptionIsSet(TS_ECHO) then + Write(c); end; end; end; diff --git a/fcl/lnet/lcontrolstack.pp b/fcl/lnet/lcontrolstack.pp index dab8451916..febc69c635 100644 --- a/fcl/lnet/lcontrolstack.pp +++ b/fcl/lnet/lcontrolstack.pp @@ -45,7 +45,7 @@ type constructor Create; procedure Clear; procedure Push(const Value: Char); - property Index: Byte read FIndex; + property ItemIndex: Byte read FIndex; property Items[i: Byte]: Char read GetItem write SetItem; default; property Full: Boolean read GetFull; property OnFull: TLOnFull read FOnFull write FOnFull; @@ -90,13 +90,12 @@ end; procedure TLControlStack.Push(const Value: Char); begin - if FIndex < TL_CSLENGTH then - begin - FItems[FIndex]:=Value; - Inc(FIndex); - if Full then - if Assigned(FOnFull) then FOnFull; - end; + if FIndex < TL_CSLENGTH then begin + FItems[FIndex]:=Value; + Inc(FIndex); + if Full and Assigned(FOnFull) then + FOnFull; + end; end; end. diff --git a/fcl/lnet/ltelnet.pp b/fcl/lnet/ltelnet.pp index c71edace56..32e36eb1f8 100644 --- a/fcl/lnet/ltelnet.pp +++ b/fcl/lnet/ltelnet.pp @@ -245,11 +245,14 @@ procedure TLTelnet.TelnetParse(const msg: string); var i: Longint; begin - if Length(msg) > 0 then - for i:=1 to Length(msg) do - if (FStack.Index > 0) or (msg[i] = TS_IAC) then + for i:=1 to Length(msg) do + if (FStack.ItemIndex > 0) or (msg[i] = TS_IAC) then begin + if msg[i] = TS_GA then + FStack.Clear + else FStack.Push(msg[i]) - else FOutput.WriteByte(Byte(msg[i])); + end else + FOutput.WriteByte(Byte(msg[i])); end; function TLTelnet.OptionIsSet(const Option: Char): Boolean;