From 786887b147cb2f8fc8c50b2d10e54da4d6c7b70c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 22 Aug 2009 23:22:50 +0000 Subject: [PATCH] (trunk libT) tell libcurl to set a time limit of 120 seconds for announces; 30 seconds for scrapes --- libtransmission/web.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libtransmission/web.c b/libtransmission/web.c index 7be53514e..0e8e35e82 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -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 );