Thread View: borland.public.cppbuilder.internet.socket
7 messages
7 total messages
Started by Hugo Dias
Tue, 13 Jul 2004 14:34
Indy TIdFTPServer DefaultDataPort Problem
Author: Hugo Dias
Date: Tue, 13 Jul 2004 14:34
Date: Tue, 13 Jul 2004 14:34
16 lines
1361 bytes
1361 bytes
Greetings, I need to synchronize two remote computers, behind ADSL routers. I'm doing PNAT to open only two ports, the FTP port and FTP DATA port. I need that DATA port be allways the same. I don't know why, but TIdFTPServer DefaultDataPort property doesn't work. It allways give me a random port. I cannot upgrade Indy due to some projects i'm developing that don't work OK with other Indy Versions. Thanks in advance, Hugo Dias
Re: Indy TIdFTPServer DefaultDataPort Problem
Author: Remy Lebeau (TeamB)
Date: Tue, 13 Jul 2004 18:42
Date: Tue, 13 Jul 2004 18:42
17 lines
1537 bytes
1537 bytes
"Hugo Dias" <synchron@nospam.synchron-systems.com> wrote in message news:40f3f2dc@newsgroups.borland.com... > I need that DATA port be allways the same. > > I don't know why, but TIdFTPServer DefaultDataPort > property doesn't work. Just saying it doesn't work says nothing at all about the actual problem you are having. You need to be more specific. Are you trying to change the property to a value different than the default value of 20? If so, which version of Indy are you actually using? If Indy 9, then it appears that the DefaultDataPort property is not actually hooked up to begin with. Gambit
Re: Indy TIdFTPServer DefaultDataPort Problem
Author: Hugo Dias
Date: Tue, 13 Jul 2004 21:00
Date: Tue, 13 Jul 2004 21:00
18 lines
1460 bytes
1460 bytes
Greetings, Thanks for ansewring. Yes i'm using Indy 9. I now know that i can solve problem on the client. I need that the PORT command will be allways : x,x,x,x,207,19 (port 53011) To do this i've altered the Indy TIdSimpleServer.pas Source code to allways use this port. I no this is not a good solution. If you have any idea how i can force the TIdFTP to use port 53011 without change Indy source i would apreciate. Best Reagards, Hugo Dias
Re: Indy TIdFTPServer DefaultDataPort Problem
Author: Remy Lebeau (TeamB)
Date: Wed, 14 Jul 2004 00:03
Date: Wed, 14 Jul 2004 00:03
79 lines
3463 bytes
3463 bytes
"Hugo Dias" <synchron@nospam.synchron-systems.com> wrote in message
news:40f44d50$1@newsgroups.borland.com...
> I now know that i can solve problem on the client.
>
> I need that the PORT command will be
> allways : x,x,x,x,207,19 (port 53011)
>
> To do this i've altered the Indy TIdSimpleServer.pas
> Source code to allways use this port.
A better solution would be to update TIdFTP to allow assigning custom values
to the TIdSimpleServer's Port property when issuing sPORT commands.
TIdSimpleServer is used in other places of Indy, so you should not mess with
it. For example (untested):
TIdFTP = class(TIdTCPClient)
protected
//...
FDefaultDataPort: Integer;
//...
published
//...
property DefaultDataPort: Integer read FDefaultDataPort write
FDefaultDataPort default 0;
//...
end;
constructor TIdFTP.Create(AOwner: TComponent);
begin
//...
FDefaultDataPort := 0;
end;
procedure TIdFTP.InternalGet(const ACommand: string; ADest: TStream;
AResume: Boolean = false);
begin
//...
FDataChannel := TIdSimpleServer.Create(nil); try
with TIdSimpleServer(FDataChannel) do begin
//...
BoundIP := (Self.IOHandler as
TIdIOHandlerSocket).Binding.IP;
BoundPort := Self.DefaultDataPort; // <-- here
BeginListen;
//...
end;
//...
end;
procedure TIdFTP.InternalPut(const ACommand: string; ASource: TStream;
AFromBeginning: Boolean = true);
begin
//...
FDataChannel := TIdSimpleServer.Create(nil); try
with TIdSimpleServer(FDataChannel) do begin
//...
BoundIP := (Self.IOHandler as
TIdIOHandlerSocket).Binding.IP;
BoundPort := Self.DefaultDataPort; // <-- here
BeginListen;
//...
end;
//...
end;
> I no this is not a good solution. If you have any idea
> how i can force the TIdFTP to use port 53011 without
> change Indy source i would apreciate.
Currently, it is not possible without changing Indy's source code. However,
you simply chose the wrong place to modify, that's all.
Either way, that does not address the original problem that exists in
TIdFTPServer. That will have to be fixed.
Gambit
Re: Indy TIdFTPServer DefaultDataPort Problem
Author: Remy Lebeau (TeamB)
Date: Wed, 14 Jul 2004 00:54
Date: Wed, 14 Jul 2004 00:54
16 lines
1567 bytes
1567 bytes
"Hugo Dias" <synchron@nospam.synchron-systems.com> wrote in message news:40f44d50$1@newsgroups.borland.com... > I no this is not a good solution. If you have any idea > how i can force the TIdFTP to use port 53011 without > change Indy source i would apreciate. I have just now updated Indy 9's snapshot to include a new DefaultDataPort property in TIdFTP, and hooked up the DefaultDataPort property in TIdFTPServer. Please download the latest snapshot of Indy 9 and see if your problems have been resolved. If so, then I can see about getting them incorporated into Indy 10 as well. Gambit
Re: Indy TIdFTPServer DefaultDataPort Problem
Author: Hugo Dias
Date: Wed, 14 Jul 2004 22:55
Date: Wed, 14 Jul 2004 22:55
16 lines
1544 bytes
1544 bytes
Thank you very much. Adding DefaultDataPort property to IdFTP solved my problem. About the DefaultDataPort on Server, i've dowloaded the latest snapshot, it seems to me that it still doesn't work. Or maybe i'm not understading well the DefaultDataPort concept on the server. If the FTP clients allways issues an PORT command when not in PASV mode, then DataPort will be allways assigned by the client. Am i missing something ? Regards, Hugo Dias
Re: Indy TIdFTPServer DefaultDataPort Problem
Author: Remy Lebeau (TeamB)
Date: Wed, 14 Jul 2004 23:18
Date: Wed, 14 Jul 2004 23:18
14 lines
1442 bytes
1442 bytes
"Hugo Dias" <synchron@nospam.synchron-systems.com> wrote in message news:40f5b9da@newsgroups.borland.com... > If the FTP clients allways issues an PORT > command when not in PASV mode, then > DataPort will be allways assigned by the client. That is correct. However, it will be a port that the client is listening on, not the server. The server only listens on ports during PASV operations. Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads