summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_http_client.h
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2021-08-11 05:43:42 +0200
committerKefu Chai <kchai@redhat.com>2021-08-13 06:21:38 +0200
commitf3f6325dbda5ec827de4d3fc1c09de08ba75da12 (patch)
tree1802fd0ebbe935dd6362e6ec879042d82291240f /src/rgw/rgw_http_client.h
parenttools: build without "using namespace std" (diff)
downloadceph-f3f6325dbda5ec827de4d3fc1c09de08ba75da12.tar.xz
ceph-f3f6325dbda5ec827de4d3fc1c09de08ba75da12.zip
rgw: build without "using namespace std"
* add "std::" prefix in headers * add "using" declarations in .cc files. so we don't rely on "using namespace std" in one or more included headers. Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/rgw/rgw_http_client.h')
-rw-r--r--src/rgw/rgw_http_client.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/rgw/rgw_http_client.h b/src/rgw/rgw_http_client.h
index 355e4181df9..d20b28cf4f9 100644
--- a/src/rgw/rgw_http_client.h
+++ b/src/rgw/rgw_http_client.h
@@ -12,8 +12,8 @@
#include <atomic>
-using param_pair_t = pair<string, string>;
-using param_vec_t = vector<param_pair_t>;
+using param_pair_t = std::pair<std::string, std::string>;
+using param_vec_t = std::vector<param_pair_t>;
void rgw_http_client_init(CephContext *cct);
void rgw_http_client_cleanup();
@@ -40,11 +40,11 @@ class RGWHTTPClient : public RGWIOProvider,
bool verify_ssl; // Do not validate self signed certificates, default to false
- string ca_path;
+ std::string ca_path;
- string client_cert;
+ std::string client_cert;
- string client_key;
+ std::string client_key;
std::atomic<unsigned> stopped { 0 };
@@ -52,12 +52,12 @@ class RGWHTTPClient : public RGWIOProvider,
protected:
CephContext *cct;
- string method;
- string url;
+ std::string method;
+ std::string url;
- string protocol;
- string host;
- string resource_prefix;
+ std::string protocol;
+ std::string host;
+ std::string resource_prefix;
size_t send_len{0};
@@ -114,14 +114,14 @@ public:
virtual ~RGWHTTPClient();
explicit RGWHTTPClient(CephContext *cct,
- const string& _method,
- const string& _url);
+ const std::string& _method,
+ const std::string& _url);
std::ostream& gen_prefix(std::ostream& out) const override;
- void append_header(const string& name, const string& val) {
- headers.push_back(pair<string, string>(name, val));
+ void append_header(const std::string& name, const std::string& val) {
+ headers.push_back(std::pair<std::string, std::string>(name, val));
}
void set_send_length(size_t len) {
@@ -159,15 +159,15 @@ public:
rgw_http_req_data *get_req_data() { return req_data; }
- string to_str();
+ std::string to_str();
int get_req_retcode();
- void set_url(const string& _url) {
+ void set_url(const std::string& _url) {
url = _url;
}
- void set_method(const string& _method) {
+ void set_method(const std::string& _method) {
method = _method;
}
@@ -179,15 +179,15 @@ public:
return user_info;
}
- void set_ca_path(const string& _ca_path) {
+ void set_ca_path(const std::string& _ca_path) {
ca_path = _ca_path;
}
- void set_client_cert(const string& _client_cert) {
+ void set_client_cert(const std::string& _client_cert) {
client_cert = _client_cert;
}
- void set_client_key(const string& _client_key) {
+ void set_client_key(const std::string& _client_key) {
client_key = _client_key;
}
};
@@ -200,8 +200,8 @@ public:
typedef std::set<header_name_t, ltstr_nocase> header_spec_t;
RGWHTTPHeadersCollector(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
const header_spec_t &relevant_headers)
: RGWHTTPClient(cct, method, url),
relevant_headers(relevant_headers) {
@@ -232,8 +232,8 @@ class RGWHTTPTransceiver : public RGWHTTPHeadersCollector {
public:
RGWHTTPTransceiver(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
bufferlist * const read_bl,
const header_spec_t intercept_headers = {})
: RGWHTTPHeadersCollector(cct, method, url, intercept_headers),
@@ -242,8 +242,8 @@ public:
}
RGWHTTPTransceiver(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
bufferlist * const read_bl,
const bool verify_ssl,
const header_spec_t intercept_headers = {})
@@ -294,10 +294,10 @@ class RGWHTTPManager {
std::atomic<unsigned> is_stopped { 0 };
ceph::shared_mutex reqs_lock = ceph::make_shared_mutex("RGWHTTPManager::reqs_lock");
- map<uint64_t, rgw_http_req_data *> reqs;
- list<rgw_http_req_data *> unregistered_reqs;
- list<set_state> reqs_change_state;
- map<uint64_t, rgw_http_req_data *> complete_reqs;
+ std::map<uint64_t, rgw_http_req_data *> reqs;
+ std::list<rgw_http_req_data *> unregistered_reqs;
+ std::list<set_state> reqs_change_state;
+ std::map<uint64_t, rgw_http_req_data *> complete_reqs;
int64_t num_reqs = 0;
int64_t max_threaded_req = 0;
int thread_pipe[2];