mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
Merge branch 'master' into pu/fb-modules
This commit is contained in:
@@ -67,7 +67,7 @@ int CHTTPTool::show_progress( void *clientp, double dltotal, double dlnow, doubl
|
||||
return 0;
|
||||
}
|
||||
//#define DEBUG
|
||||
bool CHTTPTool::downloadFile(const std::string & URL, const char * const downloadTarget, int globalProgressEnd, int connecttimeout/*=10*/, int timeout/*=1800*/)
|
||||
bool CHTTPTool::downloadFile(const std::string & URL, const char * const downloadTarget, int globalProgressEnd, int connecttimeout/*=10000*/, int timeout/*=1800*/)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
@@ -99,7 +99,7 @@ printf("url is %s\n", URL.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, connecttimeout);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, connecttimeout);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
|
||||
#ifdef DEBUG
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
@@ -137,7 +137,7 @@ printf("download code %d\n", res);
|
||||
return res==CURLE_OK;
|
||||
}
|
||||
|
||||
std::string CHTTPTool::downloadString(const std::string & URL, int globalProgressEnd, int connecttimeout/*=10*/, int timeout/*=1800*/)
|
||||
std::string CHTTPTool::downloadString(const std::string & URL, int globalProgressEnd, int connecttimeout/*=10000*/, int timeout/*=1800*/)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
@@ -163,7 +163,7 @@ printf("url is %s\n", URL.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, connecttimeout);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, connecttimeout);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
#ifdef DEBUG
|
||||
|
Reference in New Issue
Block a user