Closed mousetail closed 6 months ago
I'm getting the same error using the sync version (with rustls
):
Invalid response: [426] 426 Failure reading network stream.
The uploaded file misses some bytes at the end.
I'm getting the same error using the sync version (with
rustls
):Invalid response: [426] 426 Failure reading network stream.
The uploaded file misses some bytes at the end
Can you check if adding .close()
to the sync_ftp
like I did with the async version fixes it?
I'm not sure what the .close()
equivalent is for the sync_ftp
. I tried calling flush
and shutdown
on the underlying TcpStream
but it didn't fix the issue.
let mut stream = ftp_stream
.put_with_stream(file_name)?;
copy(bytes, &mut stream)
stream.flush()?;
stream
.get_ref()
.shutdown(std::net::Shutdown::Both)?;
ftp_stream
.finalize_put_stream(stream)?;
Description
If I upload a file using async mode and native TLS, I get the following error:
which translates as:
If I look at the logs on the server, I see:
Seems the SSL connection isn't properly terminated. Need an async drop :)
If I disable SSL or switch to the sync version, it works fine.
Steps to reproduce
Expected behaviour
The file to be uploaded normally.
Environment
Additional information
Might need a better shutdown for the data stream than drop. Drop probably can't work because it can't be async and shutting down the SSL connection requires an async frame.