]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #14117 from zhangsw/fix-rgw-getobjectmetadata-bug
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 7 Jun 2017 00:18:39 +0000 (17:18 -0700)
committerGitHub <noreply@github.com>
Wed, 7 Jun 2017 00:18:39 +0000 (17:18 -0700)
rgw: return the version id in get object and object metadata request.

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
1  2 
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index daee3f2cdb7dfe981a246aabb8ec412713c31fcd,038a5ec84c80f59e0235765aa1c5fd621a0dfea7..0118aca0c3234df73d3833ae5fbd187dfc3eee02
@@@ -1516,12 -1395,8 +1516,13 @@@ void RGWGetObj::execute(
    op_ret = read_op.prepare();
    if (op_ret < 0)
      goto done_err;
+   version_id = read_op.state.obj.key.instance;
  
 +  /* STAT ops don't need data, and do no i/o */
 +  if (get_type() == RGW_OP_STAT_OBJ) {
 +    return;
 +  }
 +
    /* start gettorrent */
    if (torrent.get_flag())
    {
Simple merge
index eef63a57ce911b3f8673ba19ccb354c84aaedbf9,b330f88ca0fce03325a210b5a16d69ec1f6f4a38..0b2550d704b2e0c0c8806af03b93c0ef6d395e89
@@@ -231,11 -216,12 +231,15 @@@ int RGWGetObj_ObjStore_S3::send_respons
      }
    }
  
 +  for (auto &it : crypt_http_responses)
 +    dump_header(s, it.first, it.second);
 +
    dump_content_length(s, total_len);
    dump_last_modified(s, lastmod);
+   if (!version_id.empty()) {
+     dump_header(s, "x-amz-version-id", version_id);
+   }
+   
  
    if (! op_ret) {
      if (! lo_etag.empty()) {