]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: get object with range should return 206
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 26 Jul 2011 22:48:19 +0000 (15:48 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 26 Jul 2011 22:48:19 +0000 (15:48 -0700)
src/rgw/rgw_common.cc
src/rgw/rgw_op.cc
src/rgw/rgw_rest_s3.cc

index c27c10a163ecd0fb1fc67c9b08a1c9576e0008e2..3f3acee34bbf920b9537735985b0e754de8fabf9 100644 (file)
@@ -40,7 +40,7 @@ is_clear() const
 bool rgw_err::
 is_err() const
 {
-  return (http_ret != 200 && http_ret != 204);
+  return !(http_ret >= 200 && http_ret <= 299);
 }
 
 
index a1f1d2c75a5c0f70b4aae9cb86cf52fb50b68e42..052bd2e79ee323bad98b0cf829e22d030b78f898 100644 (file)
@@ -69,11 +69,11 @@ static int parse_range(const char *range, off_t& ofs, off_t& end)
     ofs = atoll(ofs_str.c_str());
 
   if (end_str.length())
-  end = atoll(end_str.c_str());
+    end = atoll(end_str.c_str());
 
   RGW_LOG(10) << "parse_range ofs=" << ofs << " end=" << end << dendl;
 
-  if (end < ofs)
+  if (end >= 0 && end < ofs)
     goto done;
 
   r = 0;
index 72727e772c8aef451fe572ba40c84f3576ebafcd..574836fd3424eed33c38d6e0e2856896acfc2983 100644 (file)
@@ -71,8 +71,7 @@ int RGWGetObj_REST_S3::send_response(void *handle)
   if (range_str && !ret)
     ret = 206; /* partial content */
 done:
-  if (orig_ret)
-    set_req_state_err(s, ret);
+  set_req_state_err(s, ret);
 
   dump_errno(s);
   if (!content_type)