From 6907e85d9d3219ea62a113e2e57779deddea2620 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 10 Oct 2018 15:54:09 -0400 Subject: [PATCH] rgw: read multipart params in RGWPutObj_ObjStore_S3::get_params Signed-off-by: Casey Bodley --- src/rgw/rgw_op.h | 4 ++++ src/rgw/rgw_rest_s3.cc | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index f22c207558a9f..693f82325e23a 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -1027,6 +1027,10 @@ protected: map crypt_http_responses; string user_data; + std::string multipart_upload_id; + std::string multipart_part_str; + int multipart_part_num = 0; + boost::optional delete_at; public: diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index b98613da52210..29dc1d1af9eae 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1399,6 +1399,20 @@ int RGWPutObj_ObjStore_S3::get_params() } } + multipart_upload_id = s->info.args.get("uploadId"); + multipart_part_str = s->info.args.get("partNumber"); + if (!multipart_part_str.empty()) { + string err; + multipart_part_num = strict_strtol(multipart_part_str.c_str(), 10, &err); + if (!err.empty()) { + ldpp_dout(s, 10) << "bad part number: " << multipart_part_str << ": " << err << dendl; + return -EINVAL; + } + } else if (!multipart_upload_id.empty()) { + ldpp_dout(s, 10) << "part number with no multipart upload id" << dendl; + return -EINVAL; + } + return RGWPutObj_ObjStore::get_params(); } -- 2.39.5