#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
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;
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;
}
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);
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 {
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;
}
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();
}
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;
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;
}
}
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;
}
}
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;
*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);