veeso / suppaftp

a super FTP/FTPS client library for Rust with support for both passive and active mode
Apache License 2.0
121 stars 31 forks source link

[Feature Request] - Timeouts for active data connection acceptance #64

Closed defanor closed 10 months ago

defanor commented 11 months ago

Description

When active data connections are configured to be used, currently FtpStream waits for an incoming connection indefinitely, while it may never happen, leading to a program hanging. Would be nice if it was possible to set a timeout.

Changes

The following changes to the application are expected

Implementation

Once a setting is introduced, select or something along those lines can be called with a timeout, only calling accept when there is something to accept. For passive mode, TcpStream::connect_timeout can be used, as for the control channel.

defanor commented 10 months ago

Thanks!