add timeout to curl
This commit is contained in:
parent
a3a290534c
commit
6150f2d45c
@ -77,6 +77,8 @@ namespace utils::http
|
|||||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
|
||||||
|
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2);
|
||||||
|
|
||||||
if (!fields.empty())
|
if (!fields.empty())
|
||||||
{
|
{
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, fields.data());
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, fields.data());
|
||||||
|
Loading…
Reference in New Issue
Block a user