]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: req_state members init refactor
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 17 Nov 2017 22:49:21 +0000 (14:49 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Apr 2018 14:01:02 +0000 (07:01 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h

index d0907b87367d7ae2076dcc4be561cb6b8ea4933a..f319c5c113ab1fd854218f1a3043488455916dd2 100644 (file)
@@ -276,32 +276,14 @@ void req_info::rebuild_from(req_info& src)
 
 
 req_state::req_state(CephContext* _cct, RGWEnv* e, RGWUserInfo* u)
-  : cct(_cct), cio(NULL), op(OP_UNKNOWN), user(u), has_acl_header(false),
+  : cct(_cct), user(u),
     info(_cct, e)
 {
   enable_ops_log = e->get_enable_ops_log();
   enable_usage_log = e->get_enable_usage_log();
   defer_to_bucket_acls = e->get_defer_to_bucket_acls();
-  content_started = false;
-  format = 0;
-  formatter = NULL;
-  expect_cont = false;
-
-  obj_size = 0;
-  prot_flags = 0;
-
-  system_request = false;
 
   time = ceph_clock_now();
-  perm_mask = 0;
-  bucket_instance_shard_id = -1;
-  content_length = 0;
-  bucket_exists = false;
-  has_bad_meta = false;
-  length = NULL;
-  local_source = false;
-
-  obj_ctx = NULL;
 }
 
 req_state::~req_state() {
index fae0e698eb16874ceb6d88f0cb9c578671af7497..64789a1eb86a1e9abb3ffba33e805d0dcd637207 100644 (file)
@@ -1773,25 +1773,25 @@ class RGWRequest;
 /** Store all the state necessary to complete and respond to an HTTP request*/
 struct req_state {
   CephContext *cct;
-  rgw::io::BasicClient *cio;
+  rgw::io::BasicClient *cio{nullptr};
   RGWRequest *req{nullptr}; /// XXX: re-remove??
-  http_op op;
+  http_op op{OP_UNKNOWN};
   RGWOpType op_type{};
-  bool content_started;
-  int format;
-  ceph::Formatter *formatter;
+  bool content_started{false};
+  int format{0};
+  ceph::Formatter *formatter{nullptr};
   string decoded_uri;
   string relative_uri;
-  const char *length;
-  int64_t content_length;
+  const char *length{nullptr};
+  int64_t content_length{0};
   map<string, string> generic_attrs;
   rgw_err err;
-  bool expect_cont;
-  uint64_t obj_size;
+  bool expect_cont{false};
+  uint64_t obj_size{0};
   bool enable_ops_log;
   bool enable_usage_log;
   uint8_t defer_to_bucket_acls;
-  uint32_t perm_mask;
+  uint32_t perm_mask{0};
 
   /* Set once when url_bucket is parsed and not violated thereafter. */
   string account_name;
@@ -1810,7 +1810,7 @@ struct req_state {
   string zonegroup_name;
   string zonegroup_endpoint;
   string bucket_instance_id;
-  int bucket_instance_shard_id;
+  int bucket_instance_shard_id{-1};
   string redirect_zone_endpoint;
 
   string redirect;
@@ -1818,9 +1818,9 @@ struct req_state {
   RGWBucketInfo bucket_info;
   real_time bucket_mtime;
   std::map<std::string, ceph::bufferlist> bucket_attrs;
-  bool bucket_exists;
+  bool bucket_exists{false};
 
-  bool has_bad_meta;
+  bool has_bad_meta{false};
 
   RGWUserInfo *user;
 
@@ -1863,13 +1863,13 @@ struct req_state {
 
   /* Is the request made by an user marked as a system one?
    * Being system user means we also have the admin status. */
-  bool system_request;
+  bool system_request{false};
 
   string canned_acl;
-  bool has_acl_header;
-  bool local_source; /* source is local */
+  bool has_acl_header{false};
+  bool local_source{false}; /* source is local */
 
-  int prot_flags;
+  int prot_flags{0};
 
   /* Content-Disposition override for TempURL of Swift API. */
   struct {
@@ -1883,12 +1883,12 @@ struct req_state {
   req_init_state init_state;
 
   utime_t time;
-  void *obj_ctx;
+  void *obj_ctx{nullptr};
   string dialect;
   string req_id;
   string trans_id;
 
-  bool mfa_verified;
+  bool mfa_verified{false};
 
   req_state(CephContext* _cct, RGWEnv* e, RGWUserInfo* u);
   ~req_state();