commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Vychtrle (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (NET-568) Order of client configuration and connection is ambiguous
Date Tue, 03 Feb 2015 09:45:35 GMT

     [ https://issues.apache.org/jira/browse/NET-568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joseph Vychtrle updated NET-568:
--------------------------------
    Description: 
Hey,

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

{code:title=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. 
{code}
230 Anonymous access granted, restrictions apply
PASV
227 Entering Passive Mode (80,251,0,59,175,235).
RETR welcome.msg
150 Opening ASCII mode data connection for welcome.msg (321 bytes)
226 Transfer complete
PASV
227 Entering Passive Mode (80,251,0,59,167,178).
RETR welcome.msg
150 Opening ASCII mode data connection for welcome.msg (321 bytes)
226 Transfer complete
PASV
227 Entering Passive Mode (80,251,0,59,174,58).
RETR welcome.msg
150 Opening ASCII mode data connection for welcome.msg (321 bytes)
226 Transfer complete
{code}

But in the FTPClientExample the connect() occurs at the end.

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


  was:
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. 
{code}
230 Anonymous access granted, restrictions apply
PASV
227 Entering Passive Mode (80,251,0,59,175,235).
RETR welcome.msg
150 Opening ASCII mode data connection for welcome.msg (321 bytes)
226 Transfer complete
PASV
227 Entering Passive Mode (80,251,0,59,167,178).
RETR welcome.msg
150 Opening ASCII mode data connection for welcome.msg (321 bytes)
226 Transfer complete
PASV
227 Entering Passive Mode (80,251,0,59,174,58).
RETR welcome.msg
150 Opening ASCII mode data connection for welcome.msg (321 bytes)
226 Transfer complete
{code}

But in the FTPClientExample the connect() occurs at the end.

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



> 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:title=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. 
> {code}
> 230 Anonymous access granted, restrictions apply
> PASV
> 227 Entering Passive Mode (80,251,0,59,175,235).
> RETR welcome.msg
> 150 Opening ASCII mode data connection for welcome.msg (321 bytes)
> 226 Transfer complete
> PASV
> 227 Entering Passive Mode (80,251,0,59,167,178).
> RETR welcome.msg
> 150 Opening ASCII mode data connection for welcome.msg (321 bytes)
> 226 Transfer complete
> PASV
> 227 Entering Passive Mode (80,251,0,59,174,58).
> RETR welcome.msg
> 150 Opening ASCII mode data connection for welcome.msg (321 bytes)
> 226 Transfer complete
> {code}
> 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)

Mime
View raw message