2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-11-09 22:14:59 +00:00

Fix io-uring - read_to_end was polling Stream mapped through StreamReader after completion

This commit is contained in:
asonix 2023-07-05 00:35:07 -05:00
parent bff65e61a4
commit 2274dfecb4

View file

@ -219,6 +219,7 @@ mod io_uring {
Ok(())
}
#[tracing::instrument(level = "debug", skip_all)]
pub(crate) async fn write_from_async_read<R>(
&mut self,
mut reader: R,
@ -232,7 +233,7 @@ mod io_uring {
let max_size = 65_536;
let mut buf = Vec::with_capacity(max_size.try_into().unwrap());
let n = (&mut reader).take(max_size).read_to_end(&mut buf).await?;
let n = (&mut reader).take(max_size).read_buf(&mut buf).await?;
if n == 0 {
break;