🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #995

Re: Telnet Server just a note and a proposal

#995
From: Colin B Maharaj
Date: Fri, 22 Jun 2007 10:03
66 lines
3353 bytes
opps!
Change unsigned char s[4] to just char s[4] like this.....

//---------------------------------------------------------------------------
void __fastcall TDataModule1::TelnetConnect(TIdPeerThread *AThread)
{
   char s[4];
   s[0]=(unsigned char)255;
   s[1]=(unsigned char)254;
   s[2]=(unsigned char)1;
   s[3]=NULL;
   AThread->Connection->Write(s);
   Sleep(250);
   AThread->Connection->ReadBuffer(s, 3);
   AnsiString init="Connected to Server. You have 3 Login Attempts...\r\n";
   AThread->Connection->WriteLn(init);
}
//---------------------------------------------------------------------------



Colin B Maharaj wrote:
> Hi all I had been struggling with the IdTelnetServer all week.
> By default, the windows Telnet client echos what you type on screen.
> 
> What happens next is that is when you try to authenticate, naturally
> the username ands password gets echoed to the screen along with your 
> entire session.
> 
> What I did was this in the onconnect.....
> 
> //--------------------------------------------------------------------------- 
> 
> void __fastcall TDataModule1::TelnetConnect(TIdPeerThread *AThread)
> {
>   unsigned char s[4];
>   s[0]=(unsigned char)255;
>   s[1]=(unsigned char)254;
>   s[2]=(unsigned char)1;
>   s[3]=NULL;
>   AThread->Connection->Write(s);
>   Sleep(250);
>   AThread->Connection->ReadBuffer(s, 3);
>   AnsiString init="Connected to Server. You have 3 Login Attempts...\r\n";
>   AThread->Connection->WriteLn(init);
> }
> //--------------------------------------------------------------------------- 
> 
> 
> Those three characters are telnet protocol commands that tell
> the telnet client not to echo characters. Check the RFC.
> 
> The ReadBuffer command is required because the three characters
> that comprise the command gets echoed into the password field
> for some reason.
> 
> What I want to propose is to do this in the original indy source, or 
> have an option echo on/off in the property editor.
> 
> BTW: I use Indy 9.0.50 on BCB6 Ent. And I do not have Indy 10 maybe
> one of you folks can test to see if it has the same issue.
> 
> (just my 2 cents)
> Colin B Maharaj
> Trinidad, WI.
> 
Technical Details
Message-ID: <467b9e8a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <467b99a3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,27acd896331d1920
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 22 Jun 2007 06:03:55 -0400
From: Colin B Maharaj <noreply@myhost.com>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: Telnet Server just a note and a proposal
References: <467b99a3$1@newsgroups.borland.com>
In-Reply-To: <467b99a3$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 000751-2, 06/21/2007), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 190.58.14.113
Message-ID: <467b9e8a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1182506634 190.58.14.113 (22 Jun 2007 03:03:54 -0700)
Lines: 66
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail