From: Yehuda Sadeh Date: Wed, 20 Jan 2016 00:25:59 +0000 (-0800) Subject: rgw: a few minor cleanups X-Git-Tag: v10.0.4~152^2^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0880e5ce947d8b681a1e1813b083a752ee62cfcc;p=ceph.git rgw: a few minor cleanups delete getop, remove #warnings, add comments Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 6be1f73d0f95..798c604977cb 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -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(); diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 2e4b6322ecfd..4712a6c7fceb 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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; }