1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
6 #include "rgw_frontend.h"
7 #include "include/str_list.h"
9 #include "include/assert.h"
12 #define dout_context g_ceph_context
13 #define dout_subsys ceph_subsys_rgw
15 int RGWFrontendConfig::parse_config(const string& config,
16 map<string, string>& config_map)
18 list<string> config_list;
19 get_str_list(config, " ", config_list);
21 list<string>::iterator iter;
22 for (iter = config_list.begin(); iter != config_list.end(); ++iter) {
23 string& entry = *iter;
27 if (framework.empty()) {
29 dout(0) << "framework: " << framework << dendl;
33 ssize_t pos = entry.find('=');
35 dout(0) << "framework conf key: " << entry << dendl;
36 config_map[entry] = "";
40 int ret = parse_key_value(entry, key, val);
42 cerr << "ERROR: can't parse " << entry << std::endl;
46 dout(0) << "framework conf key: " << key << ", val: " << val << dendl;
47 config_map[key] = val;
53 bool RGWFrontendConfig::get_val(const string& key, const string& def_val,
56 map<string, string>::iterator iter = config_map.find(key);
57 if (iter == config_map.end()) {
66 bool RGWFrontendConfig::get_val(const string& key, int def_val, int *out)
69 bool found = get_val(key, "", &str);
75 *out = strict_strtol(str.c_str(), 10, &err);
77 cerr << "error parsing int: " << str << ": " << err << std::endl;
83 void RGWProcessFrontend::stop()
86 thread->kill(SIGUSR1);