From e69277378ae4bec656a0898148caa2b9ab819fdd Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 5 Oct 2015 19:43:13 +0200 Subject: [PATCH] rgw: add support for skipping manifest parsing during GET on Swift object. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_op.cc | 2 +- src/rgw/rgw_op.h | 2 ++ src/rgw/rgw_rest_swift.cc | 8 ++++++++ src/rgw/rgw_rest_swift.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index ff84aba0b064..37751ee29b2f 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -984,7 +984,7 @@ void RGWGetObj::execute() goto done_err; attr_iter = attrs.find(RGW_ATTR_USER_MANIFEST); - if (attr_iter != attrs.end()) { + if (attr_iter != attrs.end() && !skip_manifest) { ret = handle_user_manifest(attr_iter->second.c_str()); if (ret < 0) { ldout(s->cct, 0) << "ERROR: failed to handle user manifest ret=" << ret << dendl; diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index 7a196a3d6ce2..0cdca94b4a29 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -135,6 +135,7 @@ protected: bool get_data; bool partial_content; bool range_parsed; + bool skip_manifest; rgw_obj obj; utime_t gc_invalidate_time; @@ -158,6 +159,7 @@ public: get_data = false; partial_content = false; range_parsed = false; + skip_manifest = false; ret = 0; } diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index cfb447a4699e..64bb36c58b21 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -841,6 +841,14 @@ void RGWCopyObj_ObjStore_SWIFT::send_response() } } +int RGWGetObj_ObjStore_SWIFT::get_params() +{ + const string& mm = s->info.args.get("multipart-manifest"); + skip_manifest = (mm.compare("get") == 0); + + return RGWGetObj_ObjStore::get_params(); +} + int RGWGetObj_ObjStore_SWIFT::send_response_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) { string content_type; diff --git a/src/rgw/rgw_rest_swift.h b/src/rgw/rgw_rest_swift.h index 55b41bbc4e4a..1311dadb29d1 100644 --- a/src/rgw/rgw_rest_swift.h +++ b/src/rgw/rgw_rest_swift.h @@ -13,6 +13,7 @@ public: RGWGetObj_ObjStore_SWIFT() {} ~RGWGetObj_ObjStore_SWIFT() {} + int get_params(); int send_response_data(bufferlist& bl, off_t ofs, off_t len); bool need_object_expiration() { return true; } }; -- 2.47.3