From: Yehuda Sadeh Date: Fri, 16 Jan 2015 00:31:22 +0000 (-0800) Subject: rgw: fix partial GET in swift X-Git-Tag: v0.80.9~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=861a18b1f7dd5bdcbb85bc3fa15d1719bb4b2813;p=ceph.git rgw: fix partial GET in swift Fixes: #10553 backport: firefly, giant Don't set the ret code to reflect partial download, just set the response status when needed. Signed-off-by: Yehuda Sadeh (cherry picked from commit 7e1553cedff90fa0fefded65cde87ad068eb5f0c) --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 40aa4fa61e6..36544dbb5bf 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -552,7 +552,6 @@ void RGWCopyObj_ObjStore_SWIFT::send_response() int RGWGetObj_ObjStore_SWIFT::send_response_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) { const char *content_type = NULL; - int orig_ret = ret; map response_attrs; map::iterator riter; @@ -593,11 +592,7 @@ int RGWGetObj_ObjStore_SWIFT::send_response_data(bufferlist& bl, off_t bl_ofs, o } } - if (partial_content && !ret) - ret = -STATUS_PARTIAL_CONTENT; - - if (ret) - set_req_state_err(s, ret); + set_req_state_err(s, (partial_content && !ret) ? STATUS_PARTIAL_CONTENT : ret); dump_errno(s); for (riter = response_attrs.begin(); riter != response_attrs.end(); ++riter) { @@ -611,7 +606,7 @@ int RGWGetObj_ObjStore_SWIFT::send_response_data(bufferlist& bl, off_t bl_ofs, o sent_header = true; send_data: - if (get_data && !orig_ret) { + if (get_data && !ret) { int r = s->cio->write(bl.c_str() + bl_ofs, bl_len); if (r < 0) return r;