53 CURL *d_curl =
nullptr;
57 char d_error_buffer[CURL_ERROR_SIZE];
58 std::string d_content_type;
60 bool d_accept_deflate =
false;
62 std::string d_username;
63 std::string d_password;
64 std::string d_upstring;
66 std::string d_cookie_jar;
68 std::vector<std::string> d_request_headers;
70 int d_dap_client_protocol_major = 2;
71 int d_dap_client_protocol_minor = 0;
73 bool d_use_cpp_streams;
75 bool d_verbose_runtime =
false;
76 bool d_cached_response =
false;
78 std::mutex d_connect_mutex;
82 long read_url(
const std::string &url, FILE *stream, std::vector<std::string> &resp_hdrs,
83 const std::vector<std::string> &headers);
85 long read_url(
const std::string &url, FILE *stream, std::vector<std::string> &resp_hdrs);
91 bool url_uses_proxy_for(
const std::string &url);
93 bool url_uses_no_proxy_for(
const std::string &url)
noexcept;
95 void set_verbose_runtime(
bool verbose) { d_verbose_runtime = verbose; }
97 bool is_cached_response()
const {
return d_cached_response; }
131 std::lock_guard<std::mutex> lock(d_connect_mutex);
142 std::lock_guard<std::mutex> lock(d_connect_mutex);
143 d_cookie_jar = cookie_jar;
152 std::lock_guard<std::mutex> lock(d_connect_mutex);
154 d_http_cache->set_cache_enabled(enabled);
158 bool is_cache_enabled()
const {
return (d_http_cache) !=
nullptr && d_http_cache->is_cache_enabled(); }