added destructor to requester for global cleanup
This commit is contained in:
parent
567dbd584a
commit
191aafa32b
@ -30,6 +30,10 @@ requester::requester() {
|
|||||||
curl_easy_setopt(_h.get(), CURLOPT_WRITEFUNCTION, write_data);
|
curl_easy_setopt(_h.get(), CURLOPT_WRITEFUNCTION, write_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requester::~requester() {
|
||||||
|
curl_global_cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
std::string requester::get(const std::string &url) {
|
std::string requester::get(const std::string &url) {
|
||||||
curl_easy_setopt(_h.get(), CURLOPT_URL, url.c_str());
|
curl_easy_setopt(_h.get(), CURLOPT_URL, url.c_str());
|
||||||
std::vector<char> buf;
|
std::vector<char> buf;
|
||||||
|
@ -20,6 +20,7 @@ class requester {
|
|||||||
|
|
||||||
// this class is a RAII class for a curl handle
|
// this class is a RAII class for a curl handle
|
||||||
requester();
|
requester();
|
||||||
|
~requester();
|
||||||
|
|
||||||
// perform a http get request
|
// perform a http get request
|
||||||
std::string get(const std::string& url);
|
std::string get(const std::string& url);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user