Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP cannot list directory #1353

Closed
cyberduck opened this issue Nov 27, 2007 · 5 comments
Closed

FTP cannot list directory #1353

cyberduck opened this issue Nov 27, 2007 · 5 comments

Comments

@cyberduck
Copy link
Collaborator

@cyberduck cyberduck commented Nov 27, 2007

ef9961a created the issue

I have been trying to FTP into my web space. It works fine via the shell. With Cyberduck, it seems its connecting to the web space, but fails to list the files in the directory and disconnects.

I am not sure why. I have tried both FTP and FTP-SSL.

FYI
-Bulent

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Nov 29, 2007

@dkocher commented

What is the error message in Cyberduck (if any)? Please paste here to output of the 'ls' command when connecting with 'ftp' from the Terminal.app.

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Nov 30, 2007

7c2cf62 commented

I was playing around a bit with this, I posted my comments to : http://forums.cocoaforge.com/viewtopic.php?p=9956199561

I think this issue is the same as : 1302 and 1172

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Dec 4, 2007

7c2cf62 commented

FILE:
FTPControlSocket.java

FUNCTIONS:
createDataSocket() -> createDataSocketPASV()

PROBLEM DESCRIPTION:
"new FTPPassiveDataSocket(new Socket(ipAddress, port));"
This line of code is causing trouble. In case of passive mode "new Socket" might time out. In that casel a ConnectException is thrown. This exception is not taken to consideration. The 'fallback' is only watching 'FTPException' which in this case is not thrown, therefore there is no fallback to 'active' mode.

SUGGESTION:
imho the current implementation is not taking care of the timeout. To my understanding, according to j2se/1.4.2/docs/api/java/net/Socket.html#setSoTimeout(int), it would be possible to get a java.net.SocketTimeoutException.

I'm not a huge java developer so this is just a suggestion, please drop it if it's not useful.

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Dec 4, 2007

7c2cf62 commented

I've spent some time with inspecting this further on. As I googled it, it seems it's impossible to set timeout for a new Socket, so here the code always have to wait 60 seconds. The setSoTimeout(int) or the socket.connect(ip, timeout), effects only already opened connections. Unfortunately in this case no specific exception is thrown, but ConnectException. ConnectException != TimeoutException, but maybe in this specific case it could be used to start a 'fallback' for the other type of connection. If both active and passive fails with ConnectException, a specific flag could be set, and user could be informed that there was a ConnectExcepion?

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Dec 6, 2007

@dkocher commented

Applied (modified) patch in 7efa100.

@cyberduck cyberduck closed this Dec 6, 2007
@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants