diff options
author | Jan Harkes <jaharkes@cs.cmu.edu> | 2013-02-21 15:17:38 -0500 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-02-21 12:51:40 -0800 |
commit | ad00fc72e15c5c56338400b1e8862a9e4791bbe6 (patch) | |
tree | bcac7e86ce173346dd2aaf4992db27c12f9403dc | |
parent | 6d8dfb18feb4ce263453039fc0afdb1462279e9a (diff) | |
download | ceph-ad00fc72e15c5c56338400b1e8862a9e4791bbe6.tar.gz |
Fix failing > 4MB range requests through radosgw S3 API.
When a range request is made for more than rgw_get_obj_max_req_size
bytes the first returned chunk sets 'ret' to STATUS_PARTIAL_CONTENT and
all remaining chunks behave as if there is an error state and only
return a minimal header.
Fix this by passing STATUS_PARTIAL_CONTENT to set_req_state_err, but
leave the 'ret' member variable untouched.
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit c83a01d4e8dcd26eec24c020c5b79fcfa4ae44a3)
-rw-r--r-- | src/rgw/rgw_rest_s3.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index b4ddded0627..16ac4000436 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -71,7 +71,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs, off_ { const char *content_type = NULL; string content_type_str; - int orig_ret = ret; + int req_state = ret; map<string, string> response_attrs; map<string, string>::iterator riter; @@ -132,9 +132,9 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs, off_ } if (partial_content && !ret) - ret = STATUS_PARTIAL_CONTENT; + req_state = STATUS_PARTIAL_CONTENT; done: - set_req_state_err(s, ret); + set_req_state_err(s, req_state); dump_errno(s); @@ -148,7 +148,7 @@ done: 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; |