]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: a few minor cleanups
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 20 Jan 2016 00:25:59 +0000 (16:25 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 20 Jan 2016 00:26:52 +0000 (16:26 -0800)
delete getop, remove #warnings, add comments

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest.cc
src/rgw/rgw_rest_s3.cc

index 6be1f73d0f95dd3ac1608f58f0575ddddc92c6b8..798c604977cb12470f8a946d53d6996cf081c9a1 100644 (file)
@@ -698,7 +698,14 @@ void abort_early(struct req_state *s, RGWOp *op, int err_no, RGWHandler* handler
   }
   if (!error_content.empty()) {
     ldout(s->cct, 20) << "error_content is set, we need to serve it INSTEAD of firing the formatter" << dendl;
-#warning TODO we must add all error entries as headers here
+    /*
+     * FIXME we must add all error entries as headers here:
+     * when having a working errordoc, then the s3 error fields are rendered as HTTP headers, e.g.:
+     *
+     *   x-amz-error-code: NoSuchKey
+     *   x-amz-error-message: The specified key does not exist.
+     *   x-amz-error-detail-Key: foo
+     */
     end_header(s, op, NULL, NO_CONTENT_LENGTH, false, true);
     s->cio->write(error_content.c_str(), error_content.size());
     s->formatter->reset();
index 2e4b6322ecfd380aee9315c56b13f1ebeda8015f..4712a6c7fceba52febe277fa9d33b9c51847dab6 100644 (file)
@@ -2863,14 +2863,10 @@ int RGWHandler_ObjStore_S3Website::retarget(RGWOp *op, RGWOp **new_op) {
     return -ERR_WEBSITE_REDIRECT;
   }
 
-#warning FIXME
-#if 0
-  if (s->object.empty() != new_obj.empty()) {
-    op->put();
-    s->object = new_obj;
-    *new_op = get_op();
-  }
-#endif
+  /*
+   * FIXME: if s->object != new_obj, drop op and create a new op to handle operation. Or
+   * remove this comment if it's not applicable anymore
+   */
 
   s->object = new_obj;
 
@@ -2893,7 +2889,9 @@ int RGWHandler_ObjStore_S3Website::get_errordoc(const string errordoc_key, strin
     // 1. Check if errordoc exists
     // 2. Check if errordoc is public
     // 3. Fetch errordoc content
-#warning 2015119: FIXME need to clear all
+    /*
+     * FIXME maybe:  need to make sure all of the fields for conditional requests are cleared
+     */
     RGWGetObj_ObjStore_S3Website *getop = new RGWGetObj_ObjStore_S3Website(true);
     getop->set_get_data(true);
     getop->init(store, s, this);
@@ -2909,10 +2907,13 @@ int RGWHandler_ObjStore_S3Website::get_errordoc(const string errordoc_key, strin
     int64_t ofs = 0; 
     int64_t end = -1;
     ret = read_op.prepare(&ofs, &end);
-    if (ret < 0)
-      return ret;
+    if (ret < 0) {
+      goto done;
+    }
 
     ret = read_op.iterate(ofs, end, &cb); // FIXME: need to know the final size?
+done:
+    delete getop;
     return ret;
 }