Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Dec : Re: idfTP and Socks problem

www.cryer.info
Managed Newsgroup Archive

Re: idfTP and Socks problem

Subject:Re: idfTP and Socks problem
Posted by:"UlfH" (ulf_honkanen@nospam.umu.se)
Date:Wed, 12 Dec 2007 21:19:21

"Richard" <ritchie872@yahoo.com> wrote in message
news:4759e400$1@newsgroups.borland.com...
> HEllo!
>>
> What am I doing wrong here?


Nothing. Indy is doing it wrongly. They are discriminating the proxy servers
that don't have a Owner. And yet worse, if the socks component doesn't have
an owner. it is discarded and a temporary one is created. It uses the method
Assign in TIdCustomTransparentProxy.Assign(ASource: TPersistent); to copy
the proxy settings, but it forgets to set theTransparentProxy.Enabled:= true
line.

The involved methods are:

procedure TIdIOHandlerSocket.SetTransparentProxy(AProxy :
TIdCustomTransparentProxy); in IdIOhandlerSocket.pas, line 372 (a little
mess if you ask me), and

procedure TIdCustomTransparentProxy.Assign(ASource: TPersistent); in
IdCustomTransparentProxy line 127.

The solution: it's never a good idea to modify the original files because
this will break when upgrading. You could derive a class from TIdIOHandler
and overwrite the SetTransparent proxy with the good behaviour.

But in THIS case, it WOULD be safe (I think) to write this line in your
code:

if (FHandlerStack.TransparentProxy <> nil) then
  FHandlerStack.TransparentProxy.Enabled:= true;

But now we have a new problem. Enabled is Set with SetEnabled, with does
nothing in TIdCustomTransparentProxy.... (IdCustomTransparentProxy.pas ,
line 167)

Hm... I need to think a little more to find some good solution.

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive