bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug inetlib/39169] New: FTP data connection port in active mode is alwa


From: vincent_galceran at yahoo dot com
Subject: [Bug inetlib/39169] New: FTP data connection port in active mode is always the same
Date: 12 Feb 2009 16:27:08 -0000

For package gnu.java.net.protocol.ftp in FTPConnection.java in function
initialiseDTP(),

when the connection is in active mode, the listening port is defined by

int port = socket.getLocalPort() + 1;

This means :
1- the port is always the same
2- the port may not be free, if another program took it

pb 1 : the port number must change in order to be able to connect several times
to the same server. A port cannot be used twice in a row by two different
"binds". My server says "425 Can't open data connection.". I think the server
always uses the port 20 on its sides to connect to the specified port. So the
client port must change.

pb 2 : no check is made to verify whether the port is free, before sending the
"PORT" FTP command. 

In order to fix the two problems, the choice of the port should be left to the
system. In C language, when the connection uses special port 0 (zero),
'listen()' will let the system choose a free port and this port can be
retrieved.

My workaround : use passive mode.


-- 
           Summary: FTP data connection port in active mode is always the
                    same
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inetlib
        AssignedTo: dog at gnu dot org
        ReportedBy: vincent_galceran at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39169





reply via email to

[Prev in Thread] Current Thread [Next in Thread]