mirror of
https://github.com/ceph/ceph
synced 2024-12-28 06:23:08 +00:00
rgw: eradicate dynamic memory allocations from RGWEnv.
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
This commit is contained in:
parent
1c492cbba1
commit
61e35e4530
@ -175,9 +175,9 @@ req_state::req_state(CephContext* _cct, RGWEnv* e, RGWUserInfo* u)
|
||||
: cct(_cct), cio(NULL), op(OP_UNKNOWN), user(u), has_acl_header(false),
|
||||
info(_cct, e)
|
||||
{
|
||||
enable_ops_log = e->conf->enable_ops_log;
|
||||
enable_usage_log = e->conf->enable_usage_log;
|
||||
defer_to_bucket_acls = e->conf->defer_to_bucket_acls;
|
||||
enable_ops_log = e->conf.enable_ops_log;
|
||||
enable_usage_log = e->conf.enable_usage_log;
|
||||
defer_to_bucket_acls = e->conf.defer_to_bucket_acls;
|
||||
content_started = false;
|
||||
format = 0;
|
||||
formatter = NULL;
|
||||
|
@ -347,15 +347,29 @@ class RGWHTTPArgs
|
||||
}
|
||||
};
|
||||
|
||||
class RGWConf;
|
||||
class RGWEnv;
|
||||
|
||||
class RGWConf {
|
||||
friend class RGWEnv;
|
||||
protected:
|
||||
void init(CephContext *cct, RGWEnv* env);
|
||||
public:
|
||||
RGWConf()
|
||||
: enable_ops_log(1),
|
||||
enable_usage_log(1),
|
||||
defer_to_bucket_acls(0) {
|
||||
}
|
||||
|
||||
int enable_ops_log;
|
||||
int enable_usage_log;
|
||||
uint8_t defer_to_bucket_acls;
|
||||
};
|
||||
|
||||
class RGWEnv {
|
||||
std::map<string, string, ltstr_nocase> env_map;
|
||||
public:
|
||||
RGWConf *conf;
|
||||
RGWConf conf;
|
||||
|
||||
RGWEnv();
|
||||
~RGWEnv();
|
||||
void init(CephContext *cct);
|
||||
void init(CephContext *cct, char **envp);
|
||||
void set(const boost::string_ref& name, const boost::string_ref& val);
|
||||
@ -371,19 +385,6 @@ public:
|
||||
std::map<string, string, ltstr_nocase>& get_map() { return env_map; }
|
||||
};
|
||||
|
||||
class RGWConf {
|
||||
friend class RGWEnv;
|
||||
protected:
|
||||
void init(CephContext *cct, RGWEnv * env);
|
||||
public:
|
||||
RGWConf() :
|
||||
enable_ops_log(1), enable_usage_log(1), defer_to_bucket_acls(0) {}
|
||||
|
||||
int enable_ops_log;
|
||||
int enable_usage_log;
|
||||
uint8_t defer_to_bucket_acls;
|
||||
};
|
||||
|
||||
enum http_op {
|
||||
OP_GET,
|
||||
OP_PUT,
|
||||
|
@ -9,19 +9,9 @@
|
||||
|
||||
#define dout_subsys ceph_subsys_rgw
|
||||
|
||||
RGWEnv::RGWEnv()
|
||||
{
|
||||
conf = new RGWConf;
|
||||
}
|
||||
|
||||
RGWEnv::~RGWEnv()
|
||||
{
|
||||
delete conf;
|
||||
}
|
||||
|
||||
void RGWEnv::init(CephContext *cct)
|
||||
{
|
||||
conf->init(cct, this);
|
||||
conf.init(cct, this);
|
||||
}
|
||||
|
||||
void RGWEnv::set(const boost::string_ref& name, const boost::string_ref& val)
|
||||
|
Loading…
Reference in New Issue
Block a user