I had trouble with using ImplAsyncFtpStream::abort() correctly. Apparently it is possible to only pass a mutable reference for data_stream instead of full ownership, so the drop does not work.
Steps to reproduce
let _ = env_logger::builder().is_test(true).try_init();
use suppaftp::{AsyncFtpStream, Mode};
let mut ftp_stream = AsyncFtpStream::connect("127.0.0.1:1234").await?;
ftp_stream.login("anonymous", "anonymous").await?;
ftp_stream.set_mode(Mode::ExtendedPassive);
let mut stream = ftp_stream.retr_as_stream("foo").await?;
// only pass &mut:
ftp_stream.abort(&mut stream).await?;
// this code will never actually be reached:
loop {
dbg!();
}
Expected behaviour
abort() does not block indefinitely, or rather, it should be impossible to pass a reference here.
Description
I had trouble with using ImplAsyncFtpStream::abort() correctly. Apparently it is possible to only pass a mutable reference for
data_stream
instead of full ownership, so the drop does not work.Steps to reproduce
Expected behaviour
abort()
does not block indefinitely, or rather, it should be impossible to pass a reference here.Environment
Additional information
Last lines from trace log: