[jira] [Created] (NET-470) DataConnection-Socket hangs on InputStream.read()

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
Alexander Schuetz created NET-470:
-------------------------------------

             Summary: DataConnection-Socket hangs on InputStream.read()
                 Key: NET-470
                 URL: https://issues.apache.org/jira/browse/NET-470
             Project: Commons Net
          Issue Type: Bug
          Components: FTP
    Affects Versions: 3.1
         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
            Reporter: Alexander Schuetz


I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.

But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).

If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:

{color:blue}
{{C: SYST}}
{{A: 215 UNIX Type: L8}}
{{C: FEAT}}
{{A: 211-Extensions supported}}
{{A:  SIZE}}
{{A:  REST}}
{{A:  MDTM}}
{{A:  MFMT YYYYMMDDHHMMSS filename}}
{{A:  MDTM YYYYMMDDHHMMSS filename}}
{{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
{{A:  XCRC filename}}
{{A:  XMD5 filename}}
{{A:  AUTH TLS}}
{{A:  AUTH SSL}}
{{A:  MODE Z}}
{{A:  PBSZ}}
{{A:  PROT}}
{{A: 211 End of FEAT}}
{{C: USER ********}}
{{A: 331 Password required for ********}}
{{C: PASS ********}}
{{A: 230 User ******** logged in}}
{{C: PBSZ 0}}
{{A: 200 PBSZ 0 successful}}
{{C: PROT P}}
{{A: 200 Data connection set to: Private}}
{{C: TYPE I}}
{{A: 200 TYPE set to BINARY}}
{{C: PASV}}
{{A: 227 Entering passive mode (217,70,161,93,39,15)}}
{{C: LIST}}
{{A: 150 Opening ASCII mode data connection}}
{{A: 226 Directory send OK}}
{color}

Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
             
On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294296#comment-13294296 ]

Sebb commented on NET-470:
--------------------------

We'll need to know how FileZilla differs from NET.
Can you turn on command logging?

For example:
ftpclient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));

               

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294353#comment-13294353 ]

Alexander Schuetz commented on NET-470:
---------------------------------------

Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(226 Directory send OK FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

               

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Alexander Schuetz updated NET-470:
----------------------------------

    Attachment: examplePatch.diff

Diff for FTPClienntExample.java that was used to produce the posted output.
               

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294353#comment-13294353 ]

Alexander Schuetz edited comment on NET-470 at 6/13/12 11:15 AM:
-----------------------------------------------------------------

Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(226 Directory send OK FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

I'll try to get more information about the server as well...

               
      was (Author: fenvariel):
    Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(226 Directory send OK FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

                 

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294353#comment-13294353 ]

Alexander Schuetz edited comment on NET-470 at 6/13/12 11:28 AM:
-----------------------------------------------------------------

Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}
{color:blue}
QUIT
226 Directory send OK
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

I'll try to get more information about the server as well...

               
      was (Author: fenvariel):
    Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(226 Directory send OK FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

I'll try to get more information about the server as well...

                 

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294353#comment-13294353 ]

Alexander Schuetz edited comment on NET-470 at 6/13/12 11:39 AM:
-----------------------------------------------------------------

Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}
{color:blue}
QUIT
226 Directory send OK (<-- Received when reading answer for QUIT)
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

I'll try to get more information about the server as well...

               
      was (Author: fenvariel):
    Here you are:

{color:blue}
{{220 PSFTPd. Secure FTP Server ready}}
{{Connected to ******** on 990}}
{{USER *******}}
{{331 Password required for *******}}
{{PASS *******}}
{{230 User ******* logged in}}
{{SYST}}
{{215 UNIX Type: L8}}
{{Remote system is UNIX Type: L8}}
{{PBSZ 0}}
{{200 PBSZ 0 successful}}
{{PROT P}}
{{200 Data connection set to: Private}}
{{TYPE I}}
{{200 TYPE set to BINARY}}
{{PASV}}
{{227 Entering passive mode (217,70,161,93,39,12)}}
{{LIST}}
{{150 Opening ASCII mode data connection}}
{color}
{color:red}
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
   at java.io.InputStreamReader.read(InputStreamReader.java:184)
   at java.io.BufferedReader.fill(BufferedReader.java:154)
   at java.io.BufferedReader.readLine(BufferedReader.java:317)
   at java.io.BufferedReader.readLine(BufferedReader.java:382)
   at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:52)
   at org.apache.commons.net.ftp.FTPListParseEngine.readStream(FTPListParseEngine.java:133)
   at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:102)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3103)
   at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3072)
   at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2731)
   at testapplication.ftp.FTPClientExample.main(FTPClientExample.java:335)
{color}
{color:blue}
QUIT
226 Directory send OK
{color}

This was produced using Netbeans 7, JDK 1.7 and a slightly changed version of {http://www.google.de/url?sa=t&rct=j&q=ftpclientexample%20java&source=web&cd=1&ved=0CFIQFjAA&url=http%3A%2F%2Fcommons.apache.org%2Fnet%2Fexamples%2Fftp%2FFTPClientExample.java&ei=83LYT7iSH4TKsgaA_ejjDw&usg=AFQjCNHYEWShtZ-WVhvvFvmnjmsfWanevg&cad=rja]

I'll attach a diff with the modifications. Arguments are "-l -b -p SSL,true" and of course the login and server preferences.

I'll try to get more information about the server as well...

                 

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294501#comment-13294501 ]

Alexander Schuetz commented on NET-470:
---------------------------------------

I just talked to the FTP-Server admin. He told me that they are using the PSFTP-server v.1.5 Build 199.

Passive ports are between 9990 and 9999.

netstat-result: (xxx.xxx.xxx.xxx = IP in local network; yyy.yyy.yyy.yyy = IP of ftp-server)
{color:blue}
{{TCP xxx.xxx.xxx.xxx:49980  yyy.yyy.yyy.yyy:ftps ESTABLISHED}}
{{TCP xxx.xxx.xxx.xxx:49983  yyy.yyy.yyy.yyy:9999 ESTABLISHED}}
{color}
               

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Alexander Schuetz updated NET-470:
----------------------------------

    Affects Version/s: 3.0
                       3.0.1
   

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0, 3.0.1, 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294852#comment-13294852 ]

Alexander Schuetz commented on NET-470:
---------------------------------------

I just looked around for some other java libraries. ftp4j works fine:
# PBSZ 0 and PROT P are sent automatically after LOGIN and PASS
# LIST is executed without error (so, the DataConnection is established and can be read).
# disconnect() just works as expected, even without sending QUIT.

ftp4j opensource as well, so I guess you may have a look at how they handle the DataSocket.

If you want I can post my sourcecode for ftp4j as well.

{color:blue}
{{A: 220 PSFTPd. Secure FTP Server ready}}
{{C: USER *********}}
{{A: 331 Password required for *********}}
{{C: PASS ********}}
{{A: 230 User ******* logged in}}
{{C: FEAT}}
{{A: 211-Extensions supported}}
{{A:  SIZE}}
{{A:  REST}}
{{A:  MDTM}}
{{A:  MFMT YYYYMMDDHHMMSS filename}}
{{A:  MDTM YYYYMMDDHHMMSS filename}}
{{A:  MDTM YYYYMMDDHHMMSS\[+-TZ\] filename}}
{{A:  XCRC filename}}
{{A:  XMD5 filename}}
{{A:  AUTH TLS}}
{{A:  AUTH SSL}}
{{A:  MODE Z}}
{{A:  PBSZ}}
{{A:  PROT}}
{{A: 211 End of FEAT}}
{{C: PBSZ 0}}
{{A: 200 PBSZ 0 successful}}
{{C: PROT P}}
{{A: 200 Data connection set to: Private}}
{{C: TYPE A}}
{{A: 200 TYPE set to ASCII}}
{{C: PASV}}
{{A: 227 Entering passive mode (217,70,161,93,39,6)}}
{{C: LIST}}
{{A: 150 Opening ASCII mode data connection}}
{{A: 226 Directory send OK}}
{color}

If you need me to do some more tests for you, I'll be glad to help. Unfortunately and needn't provide the ftp-server credentials.
               

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0, 3.0.1, 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (NET-470) DataConnection-Socket hangs on InputStream.read()

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

    [ https://issues.apache.org/jira/browse/NET-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13404727#comment-13404727 ]

Bogdan Drozdowski commented on NET-470:
---------------------------------------

Does it work with plaintext (no SSL) connections? Perhaps you have the same problem as in NET-408, but your server doesn't break the connection with an error?
               

> DataConnection-Socket hangs on InputStream.read()
> -------------------------------------------------
>
>                 Key: NET-470
>                 URL: https://issues.apache.org/jira/browse/NET-470
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0, 3.0.1, 3.1
>         Environment: Windows 7 (x86), Netbeans 7, JDK 1.6 and JDK 1.7
>            Reporter: Alexander Schuetz
>         Attachments: examplePatch.diff
>
>
> I'm using ftps (SSL/implicit) and passive mode. connect(), login() and cwd() commands work well.
> But if I have to open a data connection (for example for LIST) the socket is opened successfully using one of the desired "dataports". The underlying InputStream is created as well without any Exception.
> But then every attempt to read from the InputStream will eventually time out or hang forever (depending on the DataTimeout-value).
> If I use the FileZilla client, everything works successfully and fast. FileZilla issues the following commands:
> {color:blue}
> {{C: SYST}}
> {{A: 215 UNIX Type: L8}}
> {{C: FEAT}}
> {{A: 211-Extensions supported}}
> {{A:  SIZE}}
> {{A:  REST}}
> {{A:  MDTM}}
> {{A:  MFMT YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS filename}}
> {{A:  MDTM YYYYMMDDHHMMSS[+-TZ] filename}}
> {{A:  XCRC filename}}
> {{A:  XMD5 filename}}
> {{A:  AUTH TLS}}
> {{A:  AUTH SSL}}
> {{A:  MODE Z}}
> {{A:  PBSZ}}
> {{A:  PROT}}
> {{A: 211 End of FEAT}}
> {{C: USER ********}}
> {{A: 331 Password required for ********}}
> {{C: PASS ********}}
> {{A: 230 User ******** logged in}}
> {{C: PBSZ 0}}
> {{A: 200 PBSZ 0 successful}}
> {{C: PROT P}}
> {{A: 200 Data connection set to: Private}}
> {{C: TYPE I}}
> {{A: 200 TYPE set to BINARY}}
> {{C: PASV}}
> {{A: 227 Entering passive mode (217,70,161,93,39,15)}}
> {{C: LIST}}
> {{A: 150 Opening ASCII mode data connection}}
> {{A: 226 Directory send OK}}
> {color}
> Issueing the commands "PBSZ 0" and "PROT P" before and calling enterLocalPassiveMode() and setFileType(FTP.BINARY_FILE_TYPE) will produce the same commandsequence (without SYST and FEAT), but with the error described above.
>              
> On top of that: disconnect() will block forever, originating from socket.close() which is blocking. The only way to avoid this is calling logout() (even if login() wasn't issued). Then disconnect will return as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira