mirror of
https://github.com/ceph/ceph
synced 2025-03-10 02:09:21 +00:00
rgw: enable access to system arguments of RGWHTTPArgs.
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
This commit is contained in:
parent
fd4d97c027
commit
cd357b6a49
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user