From 9111a4cbb2bece4299c099e2b98a4635135d0658 Mon Sep 17 00:00:00 2001 From: "Franz Heinzmann (Frando)" Date: Fri, 23 Aug 2024 23:06:18 +0200 Subject: [PATCH 1/2] fix: pass correct buffer in bulk_overwrite_full_slice --- ufotofu/src/local_nb.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ufotofu/src/local_nb.rs b/ufotofu/src/local_nb.rs index 5a30380..a55afcb 100644 --- a/ufotofu/src/local_nb.rs +++ b/ufotofu/src/local_nb.rs @@ -413,7 +413,7 @@ where let mut produced_so_far = 0; while produced_so_far < buf.len() { - match self.bulk_produce(buf).await { + match self.bulk_produce(&mut buf[produced_so_far..]).await { Ok(Left(count)) => produced_so_far += count, Ok(Right(fin)) => { return Err(OverwriteFullSliceError { From 5c595e38547927a22e66d88ec9768aceb57e8c4d Mon Sep 17 00:00:00 2001 From: Frando Date: Fri, 30 Aug 2024 23:56:52 +0200 Subject: [PATCH 2/2] fix: fix bulk_overwrite_full_slice in nb and sync producer --- ufotofu/src/nb.rs | 2 +- ufotofu/src/sync.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ufotofu/src/nb.rs b/ufotofu/src/nb.rs index c792c2f..6cd3e94 100644 --- a/ufotofu/src/nb.rs +++ b/ufotofu/src/nb.rs @@ -423,7 +423,7 @@ where let mut produced_so_far = 0; while produced_so_far < buf.len() { - match self.bulk_produce(buf).await { + match self.bulk_produce(&mut buf[produced_so_far..]).await { Ok(Left(count)) => produced_so_far += count, Ok(Right(fin)) => { return Err(OverwriteFullSliceError { diff --git a/ufotofu/src/sync.rs b/ufotofu/src/sync.rs index 0fede11..19ca01e 100644 --- a/ufotofu/src/sync.rs +++ b/ufotofu/src/sync.rs @@ -385,7 +385,7 @@ where let mut produced_so_far = 0; while produced_so_far < buf.len() { - match self.bulk_produce(buf) { + match self.bulk_produce(&mut buf[produced_so_far..]) { Ok(Left(count)) => produced_so_far += count, Ok(Right(fin)) => { return Err(OverwriteFullSliceError {