commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: FTPClient occasionally opens port to self instead of server
Date Thu, 03 Nov 2005 03:19:56 GMT

In message <20051101171737.17660@mail.digipixart.com>, "Barrie Selack" writes:
>2005-11-01 11:55:46,362 DEBUG createSocket with host: 207.www.xx.yy,
>port: 60027 with timeout of 300000
>... lots of other debugging ...
>2005-11-01 11:55:46,751 DEBUG createSocket with host: 24.www.xxx.yy,
>port: 51897 with timeout of 300000
>
>Hey! that last address is MY local address, the one the client is running on!
...
>Has anyone seen such behavior.. does FTPClient just get lost?
>
>Any help would be greatly appreciated.

Can you print the value of FTPClient.getPassiveHost() immediately
after that happens?  Also, can you log the FTP conversation with 
PrintCommandListener from src/java/examples/ so we can see how the FTP
server is responding to the PASV command?

For FTPClient hackers:
The only way I see this happening is if __passiveHost is null
when the socket is created.  __passiveHost is set to null by
enterLocalPassiveMode() and is given a value by _openDataConnection_()
by calling __parsePassiveReply() after issuing a successful pasv().
So if __parsePassiveReply() doesn't set __passiveHost, it
will remain null when SocketFactory.createSocket() is called,
causing Socket() to be called with a null host, which will
cause the local host IP to be used.  However, I don't see how
__parsePassiveReply() can leave __passiveHost null without
throwing an exception.  Therefore, the need for the extra
information.

daniel

-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
    s a v a r e s e      # In distant lands, I hear the call of my home.
   software research     # Yet my work is not done.  My journey's just begun.
http://www.savarese.com/ #  -- http://www.sleepandthetraveller.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message