Joseph Vychtrle created NET-568:
-----------------------------------

             Summary: Order of client configuration and connection is ambiguous
                 Key: NET-568
                 URL: https://issues.apache.org/jira/browse/NET-568
             Project: Commons Net
          Issue Type: Bug
          Components: FTP
    Affects Versions: 3.3
         Environment: linux, java 7
            Reporter: Joseph Vychtrle


Hey,

according to the FTPClientExample client should be first configured and set and 
connection made afterwards. But if I do this :

{code:FTPClient.java}
      FTPClient c = new FTPClient()
      customConf(c)
      val config = new FTPClientConfig("UNIX")
      config.setUnparseableEntries(true)
      c.configure(config)
      c.enterLocalPassiveMode() // required, otherwise firewall issues happen
      c.setDefaultTimeout(conf.ftpTimeout)
      c.addProtocolCommandListener(new PrintCommandListener(new 
PrintWriter(System.out), true))
      c.connect(conf.ftpHost)
{code}

Then it basically ends up this way : 
{code}
230 Anonymous access granted, restrictions apply
PORT 192,168,1,100,177,38
500 Illegal PORT command
{code}

But if I call connect() before all the client setting including 
enterLocalPassiveMode, then it works as expected. But in the FTPClientExample 
the connect() occurs at the end.

It is thread-safe, running within a single thread... What is going on here?




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to