rgw: RGWClientIO::get_env() is pure virtual now.

Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
This commit is contained in:
Radoslaw Zarzynski 2016-07-29 12:31:45 +02:00
parent ba0050865a
commit 754bf7cd1e
3 changed files with 15 additions and 8 deletions

View File

@ -13,7 +13,7 @@ void RGWClientIO::init(CephContext *cct) {
init_env(cct);
if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) {
std::map<string, string, ltstr_nocase>& env_map = env.get_map();
std::map<string, string, ltstr_nocase>& env_map = get_env().get_map();
std::map<string, string, ltstr_nocase>::iterator iter = env_map.begin();
for (iter = env_map.begin(); iter != env_map.end(); ++iter) {

View File

@ -15,19 +15,14 @@
class RGWClientIO {
protected:
RGWEnv env;
virtual void init_env(CephContext *cct) = 0;
public:
virtual ~RGWClientIO() {}
void init(CephContext *cct);
RGWEnv& get_env() {
return env;
}
virtual int complete_request() = 0; /* XXX signature likely changing */
virtual RGWEnv& get_env() = 0;
virtual int complete_request() = 0;
}; /* RGWClient IO */
@ -91,6 +86,9 @@ class RGWStreamIO : public RGWStreamIOEngine,
return _account;
}
protected:
RGWEnv env;
public:
virtual ~RGWStreamIO() {}
RGWStreamIO()
@ -108,6 +106,10 @@ public:
std::string grab_aws4_sha256_hash();
RGWEnv& get_env() override {
return env;
}
void set_account(bool _accnt) override {
_account = _accnt;
}

View File

@ -54,6 +54,7 @@ namespace rgw {
public RGWClientIOAccounter
{
RGWUserInfo user_info;
RGWEnv env;
public:
RGWLibIO() {
get_env().set("HTTP_HOST", "");
@ -76,6 +77,10 @@ namespace rgw {
int complete_header();
int send_content_length(uint64_t len);
RGWEnv& get_env() override {
return env;
}
int complete_request() override { /* XXX */
return 0;
};