What happens if the command PASV (when
FTP.Passive:=true) is returned to a private address by mistake on the remote server firewall config? eg'227 Entering Passive Mode (192,168,148,37,129,44)'. We receiving error 425 can't open data connection! I am using synapse 4.0 and Lazarus 2.0.10. In most famous ftp clients (filezilla,winscp etc) user can replace or better force the public ip of remote server before send a data command to ftp server. With few code line addition to
Class TFTPSend in
unit ftpsend we can reestablish lost data connection.
- a) Add a boolean variable to protected part of class eg
- b) Add a boolean property to published part of class eg
property ForceIP: Boolean read FForceIP write FForceIP;
permits to change the above variable
function TFTPSend.DataSocket: boolean;
after the command
in passive mode first part of function adding the following command
if FForceIP then FDataIP:=FTargetHost;
that replaces private IP given by PASV command with the IP of remote ftp server.
- d) To enable force remote host IP address just set
and
. Τhe data channel is now returning and operating normally!