From: Robin H. Johnson Date: Thu, 3 Dec 2015 23:13:18 +0000 (-0800) Subject: Undo constant renaming: RGW_REST_*->RGW_PROTO_*. X-Git-Tag: v10.0.4~152^2^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d74d9648cec2a615c128b2ce5897e79ea9557783;p=ceph.git Undo constant renaming: RGW_REST_*->RGW_PROTO_*. For clarity, RGW_REST_* should be renamed to RGW_PROTO_* in future. For now, undo it to ease the merging speed for static-sites. Signed-off-by: Robin H. Johnson --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 41eeb631cc1b..58b4fc476c64 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -99,10 +99,10 @@ using ceph::crypto::MD5; #define RGW_CAP_WRITE 0x2 #define RGW_CAP_ALL (RGW_CAP_READ | RGW_CAP_WRITE) -#define RGW_PROTO_SWIFT 0x1 -#define RGW_PROTO_SWIFT_AUTH 0x2 -#define RGW_PROTO_S3 0x4 -#define RGW_PROTO_WEBSITE 0x8 +#define RGW_REST_SWIFT 0x1 +#define RGW_REST_SWIFT_AUTH 0x2 +#define RGW_REST_S3 0x4 +#define RGW_REST_WEBSITE 0x8 #define RGW_SUSPENDED_USER_AUID (uint64_t)-2 diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f46bec0edffe..4e551f83f569 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -3597,7 +3597,7 @@ void RGWListBucketMultiparts::execute() if (ret < 0) return; - if (s->prot_flags & RGW_PROTO_SWIFT) { + if (s->prot_flags & RGW_REST_SWIFT) { string path_args; path_args = s->info.args.get("path"); if (!path_args.empty()) { diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index d5ccb155fbf0..dde67a4606d9 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -309,7 +309,7 @@ void set_req_state_err(struct req_state *s, int err_no) err_no = -err_no; s->err.ret = -err_no; - if (s->prot_flags & RGW_PROTO_SWIFT) { + if (s->prot_flags & RGW_REST_SWIFT) { r = search_err(err_no, RGW_HTTP_SWIFT_ERRORS, ARRAY_LEN(RGW_HTTP_SWIFT_ERRORS)); if (r) { s->err.http_ret = r->http_ret; @@ -320,7 +320,7 @@ void set_req_state_err(struct req_state *s, int err_no) r = search_err(err_no, RGW_HTTP_ERRORS, ARRAY_LEN(RGW_HTTP_ERRORS)); if (r) { - if (s->prot_flags & RGW_PROTO_WEBSITE && err_no == ERR_WEBSITE_REDIRECT && !s->err.is_clear()) { + if (s->prot_flags & RGW_REST_WEBSITE && err_no == ERR_WEBSITE_REDIRECT && !s->err.is_clear()) { // http_ret was custom set, so don't change it! } else { s->err.http_ret = r->http_ret; @@ -375,7 +375,7 @@ void dump_etag(struct req_state * const s, const char * const etag) } int r; - if (s->prot_flags & RGW_PROTO_SWIFT) { + if (s->prot_flags & RGW_REST_SWIFT) { r = s->cio->print("etag: %s\r\n", etag); } else { r = s->cio->print("ETag: \"%s\"\r\n", etag); @@ -533,7 +533,7 @@ void dump_start(struct req_state *s) void dump_trans_id(req_state *s) { - if (s->prot_flags & RGW_PROTO_SWIFT) { + if (s->prot_flags & RGW_REST_SWIFT) { s->cio->print("X-Trans-Id: %s\r\n", s->trans_id.c_str()); } else { @@ -552,7 +552,7 @@ void end_header(struct req_state *s, RGWOp *op, const char *content_type, const dump_access_control(s, op); } - if (s->prot_flags & RGW_PROTO_SWIFT && !content_type) { + if (s->prot_flags & RGW_REST_SWIFT && !content_type) { force_content_type = true; } @@ -573,7 +573,7 @@ void end_header(struct req_state *s, RGWOp *op, const char *content_type, const ctype = "text/plain"; break; } - if (s->prot_flags & RGW_PROTO_SWIFT) + if (s->prot_flags & RGW_REST_SWIFT) ctype.append("; charset=utf-8"); content_type = ctype.c_str(); } @@ -1227,7 +1227,7 @@ int RGWHandler_ObjStore::allocate_formatter(struct req_state *s, int default_typ s->formatter = new JSONFormatter(false); break; case RGW_FORMAT_HTML: - s->formatter = new HTMLFormatter(s->prot_flags & RGW_PROTO_WEBSITE); + s->formatter = new HTMLFormatter(s->prot_flags & RGW_REST_WEBSITE); break; default: return -EINVAL; @@ -1455,7 +1455,7 @@ int RGWREST::preprocess(struct req_state *s, RGWClientIO *cio) in_hosted_domain = true; // TODO: should hostnames be a strict superset of hostnames_s3website? domain = s3website_domain; subdomain = s3website_subdomain; - s->prot_flags |= RGW_PROTO_WEBSITE; + s->prot_flags |= RGW_REST_WEBSITE; } } @@ -1485,7 +1485,7 @@ int RGWREST::preprocess(struct req_state *s, RGWClientIO *cio) in_hosted_domain = true; // TODO: should hostnames be a strict superset of hostnames_s3website? domain = s3website_domain; subdomain = s3website_subdomain; - s->prot_flags |= RGW_PROTO_WEBSITE; + s->prot_flags |= RGW_REST_WEBSITE; } } diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index e58122efe15e..29033512a0c3 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2593,7 +2593,7 @@ int RGWHandler_Auth_S3::init(RGWRados *store, struct req_state *state, RGWClient RGWHandler *RGWRESTMgr_S3::get_handler(struct req_state *s) { - bool is_s3website = enable_s3website && (s->prot_flags & RGW_PROTO_WEBSITE); + bool is_s3website = enable_s3website && (s->prot_flags & RGW_REST_WEBSITE); int ret = RGWHandler_ObjStore_S3::init_from_header(s, is_s3website ? RGW_FORMAT_HTML : RGW_FORMAT_XML, false); if (ret < 0) return NULL; @@ -2626,7 +2626,7 @@ int RGWHandler_ObjStore_S3Website::retarget(RGWOp *op, RGWOp **new_op) { *new_op = op; ldout(s->cct, 10) << __func__ << "Starting retarget" << dendl; - if (!(s->prot_flags & RGW_PROTO_WEBSITE)) + if (!(s->prot_flags & RGW_REST_WEBSITE)) return 0; RGWObjectCtx& obj_ctx = *static_cast(s->obj_ctx); diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 2def0e965810..64bb36c58b21 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -1111,7 +1111,7 @@ int RGWHandler_ObjStore_SWIFT::init_from_header(struct req_state *s) string req; string first; - s->prot_flags |= RGW_PROTO_SWIFT; + s->prot_flags |= RGW_REST_SWIFT; const char *req_name = s->decoded_uri.c_str(); const char *p;