(trunk libT) tell libcurl to set a time limit of 120 seconds for announces; 30 seconds for scrapes

This commit is contained in:
Charles Kerr 2009-08-22 23:22:50 +00:00
parent a61a5779f8
commit 786887b147
1 changed files with 7 additions and 0 deletions

View File

@ -197,6 +197,13 @@ addTask( void * vtask )
curl_easy_setopt( easy, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 360L );
curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 60L );
/* set a time limit for announces & scrapes */
if( strstr( task->url, "announce" ) )
curl_easy_setopt( easy, CURLOPT_TIMEOUT, 120L );
else if( strstr( task->url, "scrape" ) )
curl_easy_setopt( easy, CURLOPT_TIMEOUT, 30L );
curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1L );
curl_easy_setopt( easy, CURLOPT_FORBID_REUSE, 1L );
curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16L );