]> git-server-git.apps.pok.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>
Thu, 26 Jan 2017 21:50:51 +0000 (16:50 -0500)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 53521efffb1cb92e5f5ce992d4127bf9498d7c33)

src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index dc0eb0b45441118790754fda96adccb9a68b32ac..15ea72362ed48b8cfb592deabd70e8969f3a6e9e 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 8ef243e738a38ca7a028a3726654904aa16317ae..8cca01b4292133e5142310fbfefd82e78b04cd22 100644 (file)
@@ -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;