]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Undo constant renaming: RGW_REST_*->RGW_PROTO_*.
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 3 Dec 2015 23:13:18 +0000 (15:13 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 15 Jan 2016 23:05:47 +0000 (15:05 -0800)
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 <robin.johnson@dreamhost.com>
src/rgw/rgw_common.h
src/rgw/rgw_op.cc
src/rgw/rgw_rest.cc
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_swift.cc

index 41eeb631cc1be12e6f4c4ea24938d31d5d616d28..58b4fc476c641bf693dad0451b653856ee0796ff 100644 (file)
@@ -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
 
index f46bec0edffecfadd0cfddeff68a23c71a101151..4e551f83f569f8c8b0a9ebd5b87af29a95b81779 100644 (file)
@@ -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()) {
index d5ccb155fbf0f8edf622653a4f3d4528a0045ec9..dde67a4606d96929c46fb31960b691fc483a59a0 100644 (file)
@@ -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;
            }
         }
 
index e58122efe15ece9289e6de545c3ecff6d2e7f12f..29033512a0c3162d87c63b345feb923fb396aaaa 100644 (file)
@@ -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<RGWObjectCtx *>(s->obj_ctx);
index 2def0e96581075808c3936c58ee1e949dad26955..64bb36c58b219cb13fd46de89bdc18759427125b 100644 (file)
@@ -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;