mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add HttpRequest::timeoutMs
This commit is contained in:
parent
f44d3355f9
commit
a5f9eafe23
2 changed files with 4 additions and 0 deletions
|
|
@ -82,6 +82,9 @@ public:
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &entry->buffer);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &entry->buffer);
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/7.81.0");
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/7.81.0");
|
||||||
|
if (request.timeoutMs > 0) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, request.timeoutMs);
|
||||||
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ namespace network {
|
||||||
bool followLocation = false;
|
bool followLocation = false;
|
||||||
bool verifySSL = true;
|
bool verifySSL = true;
|
||||||
long maxSize = -1;
|
long maxSize = -1;
|
||||||
|
long timeoutMs = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Requests {
|
class Requests {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue