system/httptool: make timeouts flexible

Origin commit data
------------------
Branch: ni/coolstream
Commit: 8423c3356b
Author: FlatTV <FlatTV@gmx.de>
Date: 2016-07-09 (Sat, 09 Jul 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
FlatTV
2016-07-09 14:58:40 +02:00
parent 2f8caeb659
commit 5ec334a785
2 changed files with 4 additions and 4 deletions

View File

@@ -58,7 +58,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)
bool CHTTPTool::downloadFile(const std::string & URL, const char * const downloadTarget, int globalProgressEnd,/*NI*/int connecttimeout,/*NI*/int timeout)
{
CURL *curl;
CURLcode res;
@@ -90,8 +90,8 @@ printf("url is %s\n", URL.c_str());
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str());
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1800);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); //NI
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, connecttimeout); //NI
curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
#ifdef DEBUG
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);