mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 19:31:35 +00:00
Fix io-uring - read_to_end was polling Stream mapped through StreamReader after completion
This commit is contained in:
parent
bff65e61a4
commit
2274dfecb4
1 changed files with 2 additions and 1 deletions
|
@ -219,6 +219,7 @@ mod io_uring {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
pub(crate) async fn write_from_async_read<R>(
|
pub(crate) async fn write_from_async_read<R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
mut reader: R,
|
mut reader: R,
|
||||||
|
@ -232,7 +233,7 @@ mod io_uring {
|
||||||
let max_size = 65_536;
|
let max_size = 65_536;
|
||||||
let mut buf = Vec::with_capacity(max_size.try_into().unwrap());
|
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 {
|
if n == 0 {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue