]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: multipart copy-part handle versionId
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 30 Sep 2016 00:43:35 +0000 (17:43 -0700)
committerMatt Benjamin <mbenjamin@redhat.com>
Mon, 27 Mar 2017 22:51:23 +0000 (18:51 -0400)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 53521efffb1cb92e5f5ce992d4127bf9498d7c33)

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index abe5e3882162ecd821859e7e25bf14db19366559..f8875202a8e22f2391ba5f0a16b6d6f163bef7ff 100644 (file)
@@ -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;
index 18a5593f41f7675e7eb673fa9f61d1a28ffd6b93..24b72a8baa87900f91383c83dac0e8a486787c4e 100644 (file)
@@ -1073,6 +1073,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;