Skip to content

Commit

Permalink
rgw: multipart copy-part handle versionId
Browse files Browse the repository at this point in the history
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Sep 30, 2016
1 parent 6e9b824 commit 53521ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rgw/rgw_op.h
Expand Up @@ -659,6 +659,7 @@ class RGWPutObj : public RGWOp {
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;
Expand Down
8 changes: 8 additions & 0 deletions src/rgw/rgw_rest_s3.cc
Expand Up @@ -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;
Expand Down

0 comments on commit 53521ef

Please sign in to comment.