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

Possible bug: creating empty files using FileZilla fails on data connection timeout #366

Open
benallfree opened this issue Jan 29, 2024 · 1 comment

Comments

@benallfree
Copy link

benallfree commented Jan 29, 2024

I don't know enough about FTP to say whether this is a bug in FileZilla or in ftp-srv, but here's what happens:

When FileZilla creates an empty file (whether via Create file or transferring a 0-byte file), it sends a STOR command and waits for a response. It doesn't immediately open a data connection, so ftp-serve hangs on https://github.com/QuorumDMS/ftp-srv/blob/main/src/commands/registration/stor.js#L12

return this.connector.waitForConnection()

and never responds with a 150.

The behavior is different in FileZilla when the file has data. It immediately opens the data connection, so everything works fine.

I found a post about a similar problem https://forum.filezilla-project.org/viewtopic.php?p=170842#p170842 which says

The establishment of the data connection can happen before or after the STOR command.

Cross-posted https://forum.filezilla-project.org/viewtopic.php?f=2&t=58127

@cazagw
Copy link

cazagw commented Jan 30, 2024

Interesting, I was about to create an issue as i have the same problem but with other commands (LIST and STOR, even with data) using curlftpfs as the client, but only with TLS enabled.
(seem to also be the case with your issue, it fails with tls enabled, but works fine with it disabled from my tests)

this.connector.waitForConnection() seems to be hanging due to dataSocket not being defined.
I managed to narrow down the issue to tls.createServer not calling the connectionhandler, but not sure why it happens nor how to fix it :

this.dataServer = (this.connection.secure ? tls : net).createServer(serverOptions, connectionHandler);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants