aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/multipart.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-07 15:25:49 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-07 15:32:51 +0100
commite011941964b1c1e0b90f85014d166d64a83ae8e2 (patch)
tree5c5cef9af72d48dd7347922341e43f0013380c60 /src/api/s3/multipart.rs
parent53746b59e525ff5f518ed59d7831b05e2732785d (diff)
downloadgarage-e011941964b1c1e0b90f85014d166d64a83ae8e2.tar.gz
garage-e011941964b1c1e0b90f85014d166d64a83ae8e2.zip
[dep-upgrade-202402] refactor use of BodyStream
Diffstat (limited to 'src/api/s3/multipart.rs')
-rw-r--r--src/api/s3/multipart.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/api/s3/multipart.rs b/src/api/s3/multipart.rs
index 4aa27eaf..b9d15b21 100644
--- a/src/api/s3/multipart.rs
+++ b/src/api/s3/multipart.rs
@@ -1,8 +1,7 @@
use std::collections::HashMap;
use std::sync::Arc;
-use futures::{prelude::*, TryStreamExt};
-use http_body_util::BodyStream;
+use futures::prelude::*;
use hyper::{Request, Response};
use md5::{Digest as Md5Digest, Md5};
@@ -89,10 +88,8 @@ pub async fn handle_put_part(
// Read first chuck, and at the same time try to get object to see if it exists
let key = key.to_string();
- let body_stream = BodyStream::new(req.into_body())
- .map(|x| x.map(|f| f.into_data().unwrap())) //TODO remove unwrap
- .map_err(Error::from);
- let mut chunker = StreamChunker::new(body_stream, garage.config.block_size);
+ let stream = body_stream(req.into_body());
+ let mut chunker = StreamChunker::new(stream, garage.config.block_size);
let ((_, _, mut mpu), first_block) = futures::try_join!(
get_upload(&garage, &bucket_id, &key, &upload_id),