From: Yehuda Sadeh Date: Fri, 30 Sep 2016 00:43:35 +0000 (-0700) Subject: rgw: multipart copy-part handle versionId X-Git-Tag: v10.2.6~141^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f99ead1570a23a9050e396383006deb2e7e1d9f8;p=ceph.git rgw: multipart copy-part handle versionId Signed-off-by: Yehuda Sadeh (cherry picked from commit 53521efffb1cb92e5f5ce992d4127bf9498d7c33) --- diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index dc0eb0b4544..15ea72362ed 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -656,6 +656,7 @@ protected: string copy_source_tenant_name; string copy_source_bucket_name; string copy_source_object_name; + string copy_source_version_id; off_t copy_source_range_fst; off_t copy_source_range_lst; string etag; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 8ef243e738a..8cca01b4292 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1072,6 +1072,14 @@ int RGWPutObj_ObjStore_S3::get_params() } copy_source_object_name = copy_source_bucket_name.substr(pos + 1, copy_source_bucket_name.size()); copy_source_bucket_name = copy_source_bucket_name.substr(0, pos); +#define VERSION_ID_STR "?versionId=" + pos = copy_source_object_name.find(VERSION_ID_STR); + if (pos == std::string::npos) { + url_decode(copy_source_object_name, copy_source_object_name); + } else { + copy_source_version_id = copy_source_object_name.substr(pos + sizeof(VERSION_ID_STR) - 1); + url_decode(copy_source_object_name.substr(0, pos), copy_source_object_name); + } pos = copy_source_bucket_name.find(":"); if (pos == std::string::npos) { copy_source_tenant_name = s->src_tenant_name;