diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index 55e97c75f..aaa8626fe 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -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); diff --git a/src/system/httptool.h b/src/system/httptool.h index c0b3f487f..a414d683b 100644 --- a/src/system/httptool.h +++ b/src/system/httptool.h @@ -51,7 +51,7 @@ class CHTTPTool CHTTPTool(); void setStatusViewer( CProgressWindow* statusview ); - bool downloadFile( const std::string & URL, const char * const downloadTarget, int globalProgressEnd=-1 ); + bool downloadFile( const std::string & URL, const char * const downloadTarget, int globalProgressEnd=-1,/*NI*/int connecttimeout=10,/*NI*/int timeout=1800); };