rgw: enable access to system arguments of RGWHTTPArgs.

Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
This commit is contained in:
Radoslaw Zarzynski 2016-02-16 11:35:34 +01:00
parent fd4d97c027
commit cd357b6a49
2 changed files with 21 additions and 0 deletions

View File

@ -704,6 +704,23 @@ void RGWHTTPArgs::get_bool(const char *name, bool *val, bool def_val)
}
}
string RGWHTTPArgs::sys_get(const string& name, bool * const exists)
{
const auto iter = sys_val_map.find(name);
const bool e = (iter != val_map.end());
if (exists) {
*exists = e;
}
return e ? iter->second : string();
}
string RGWHTTPArgs::sys_get(const char * const name, bool * const exists)
{
return sys_get(string(name), exists);
}
bool verify_requester_payer_permission(struct req_state *s)
{
if (!s->bucket_info.requester_pays)

View File

@ -297,6 +297,10 @@ class RGWHTTPArgs
int get_bool(const char *name, bool *val, bool *exists);
void get_bool(const char *name, bool *val, bool def_val);
/** Get the value for specific system argument parameter */
string sys_get(const string& name, bool *exists = nullptr);
string sys_get(const char *name, bool *exists = nullptr);
/** see if a parameter is contained in this RGWHTTPArgs */
bool exists(const char *name) {
map<string, string>::iterator iter = val_map.find(name);