|
|
@@ -22,7 +22,7 @@ static CURL* createCurl() { |
|
|
|
CURL* curl = curl_easy_init(); |
|
|
|
assert(curl); |
|
|
|
|
|
|
|
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); |
|
|
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); |
|
|
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); |
|
|
|
// 15 second timeout for requests |
|
|
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15); |
|
|
@@ -214,7 +214,7 @@ bool requestDownload(const std::string& url, const std::string& filename, float* |
|
|
|
|
|
|
|
|
|
|
|
std::string encodeUrl(const std::string& s) { |
|
|
|
CURL* curl = curl_easy_init(); |
|
|
|
CURL* curl = createCurl(); |
|
|
|
DEFER({curl_easy_cleanup(curl);}); |
|
|
|
assert(curl); |
|
|
|
char* escaped = curl_easy_escape(curl, s.c_str(), s.size()); |
|
|
|