ftpserverlib icon indicating copy to clipboard operation
ftpserverlib copied to clipboard

IdleTimeout doesn't factor in active data connection (large or slow transfers)

Open dkandarp opened this issue 1 year ago • 2 comments

When control connection is idle for more than IdleTimeout duration, server immediately closes control connection and ignores on going data transfer through data connection. https://github.com/fclairamb/ftpserverlib/blob/main/client_handler.go#L413

This is not correct behavior. Transfer rate and time can very depending on network and file size. Before terminating control connection, server should check if there is any active data connection.

dkandarp avatar Jan 30 '24 23:01 dkandarp

Hello,

this is a known issue. I think most users handle idle connections outside of the library (and I'm not sure if their management needs to be done inside the library), however since this is an advertised feature, we can review a PR if you'd like to send some one. Thank you

drakkan avatar Feb 10 '24 09:02 drakkan

Hello,

this is a known issue. I think most users handle idle connections outside of the library (and I'm not sure if their management needs to be done inside the library), however since this is an advertised feature, we can review a PR if you'd like to send some one. Thank you

Does it mean specify idle timeout with large arbitrary value to avoid deadline, and manage connection through Driver?
Since connection is initiated inside library, I think its lifecycle should be encapsulated within library.

Happy to work on PR, will submit shortly.

dkandarp avatar Feb 12 '24 06:02 dkandarp