* fixes some telnet issues with TS_GA (go ahead) command

git-svn-id: trunk@5293 -
This commit is contained in:
Almindor 2006-11-08 22:30:39 +00:00
parent 25fb2bab81
commit 80d964067a
3 changed files with 16 additions and 13 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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;