fix maximum payload of 16 kB by using write_all method, hold bytes on request error

This commit is contained in:
yggverse 2025-02-24 07:49:41 +02:00
parent 4f6799a495
commit 1ff38ee838
3 changed files with 20 additions and 11 deletions

View file

@ -44,7 +44,10 @@ pub fn from_stream_async(
return on_complete(Ok((file_output_stream, total)));
}
file_output_stream.clone().write_async(
// Make sure **all bytes** sent to the destination
// > A partial write is performed with the size of a message block, which is 16kB
// > https://docs.openssl.org/3.0/man3/SSL_write/#notes
file_output_stream.clone().write_all_async(
bytes.clone(),
priority,
Some(&cancellable.clone()),