aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/get.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-05-03 12:02:59 +0200
committerAlex Auvolat <alex@adnab.me>2023-06-09 16:23:37 +0200
commit82e75c0e296c74c374f3d40feeb1aadcb58398f0 (patch)
tree5449f6cd219e9b6628cb10d70f86a952d5b35382 /src/api/s3/get.rs
parent38d6ac429506f9f488ac522581b12fa530442a59 (diff)
downloadgarage-82e75c0e296c74c374f3d40feeb1aadcb58398f0.tar.gz
garage-82e75c0e296c74c374f3d40feeb1aadcb58398f0.zip
Adapt S3 API code to use new multipart upload models
- Create and PutPart - completemultipartupload - upload part copy - list_parts
Diffstat (limited to 'src/api/s3/get.rs')
-rw-r--r--src/api/s3/get.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/api/s3/get.rs b/src/api/s3/get.rs
index 2a99551a..aa391745 100644
--- a/src/api/s3/get.rs
+++ b/src/api/s3/get.rs
@@ -149,7 +149,6 @@ pub async fn handle_head(
let (part_offset, part_end) =
calculate_part_bounds(&version, pn).ok_or(Error::InvalidPart)?;
- let n_parts = version.parts_etags.items().len();
Ok(object_headers(object_version, version_meta)
.header(CONTENT_LENGTH, format!("{}", part_end - part_offset))
@@ -162,7 +161,7 @@ pub async fn handle_head(
version_meta.size
),
)
- .header(X_AMZ_MP_PARTS_COUNT, format!("{}", n_parts))
+ .header(X_AMZ_MP_PARTS_COUNT, format!("{}", version.n_parts()?))
.status(StatusCode::PARTIAL_CONTENT)
.body(Body::empty())?)
}
@@ -376,7 +375,6 @@ async fn handle_get_part(
let (begin, end) =
calculate_part_bounds(&version, part_number).ok_or(Error::InvalidPart)?;
- let n_parts = version.parts_etags.items().len();
let body = body_from_blocks_range(garage, version.blocks.items(), begin, end);
@@ -386,7 +384,7 @@ async fn handle_get_part(
CONTENT_RANGE,
format!("bytes {}-{}/{}", begin, end - 1, version_meta.size),
)
- .header(X_AMZ_MP_PARTS_COUNT, format!("{}", n_parts))
+ .header(X_AMZ_MP_PARTS_COUNT, format!("{}", version.n_parts()?))
.body(body)?)
}
_ => unreachable!(),