add timeout for libcurl

This commit is contained in:
cppla 2022-07-16 13:45:37 +08:00
parent 022e5edb28
commit 2703993272

@ -345,6 +345,8 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
curl_easy_setopt(curl, CURLOPT_URL, urlBuffer);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3L);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 6L);
res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));