Skip to content

Commit

Permalink
rgw: add support for skipping manifest parsing during GET on Swift ob…
Browse files Browse the repository at this point in the history
…ject.

Signed-off-by: Radoslaw Zarzynski <rzarzynski@github.com>
  • Loading branch information
Radoslaw Zarzynski committed Oct 8, 2015
1 parent 5e9cf8e commit 2f58c2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rgw/rgw_op.cc
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/rgw/rgw_op.h
Expand Up @@ -135,6 +135,7 @@ class RGWGetObj : public RGWOp {
bool get_data;
bool partial_content;
bool range_parsed;
bool skip_manifest;
rgw_obj obj;
utime_t gc_invalidate_time;

Expand All @@ -158,6 +159,7 @@ class RGWGetObj : public RGWOp {
get_data = false;
partial_content = false;
range_parsed = false;
skip_manifest = false;
ret = 0;
}

Expand Down
8 changes: 8 additions & 0 deletions src/rgw/rgw_rest_swift.cc
Expand Up @@ -841,6 +841,14 @@ void RGWCopyObj_ObjStore_SWIFT::send_response()
}
}

int RGWGetObj_ObjStore_SWIFT::get_params()
{
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;
Expand Down
1 change: 1 addition & 0 deletions src/rgw/rgw_rest_swift.h
Expand Up @@ -13,6 +13,7 @@ class RGWGetObj_ObjStore_SWIFT : public RGWGetObj_ObjStore {
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; }
};
Expand Down

0 comments on commit 2f58c2f

Please sign in to comment.