From 98168cb6054a97bed6d0a32021329ea32b87982c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 27 Oct 2008 18:00:03 +0000 Subject: [PATCH] (libT) #1359: Transmission shows no tracker error when unable to contact the tracker --- libtransmission/tracker.c | 8 ++++++++ libtransmission/web.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index 0dc3bd3a4..693bd6e55 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -444,6 +444,14 @@ onTrackerResponse( tr_session * session, if( bencLoaded ) tr_bencFree( &benc ); } + else + { + char * buf = tr_strdup_printf( _( "Tracker request failed. Got HTTP Status Code %ld (%s)" ), + responseCode, + tr_webGetResponseStr( responseCode ) ); + publishWarning( t, buf ); + tr_free( buf ); + } retry = updateAddresses( t, success ); diff --git a/libtransmission/web.c b/libtransmission/web.c index 1cffc4959..481fc54ea 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -29,13 +29,19 @@ /* arbitrary number */ #define DEFAULT_TIMER_MSEC 2000 +#if 0 +#define dbgmsg(...) \ + do { \ + fprintf( stderr, __VA_ARGS__ ); \ + fprintf( stderr, "\n" ); \ + } while( 0 ) +#else #define dbgmsg( ... ) \ do { \ if( tr_deepLoggingIsActive( ) ) \ tr_deepLog( __FILE__, __LINE__, "web", __VA_ARGS__ ); \ } while( 0 ) -/* #define dbgmsg(...) \ - do { fprintf( stderr, __VA_ARGS__ ); fprintf( stderr, "\n" ); } while( 0 ) */ +#endif struct tr_web { @@ -113,6 +119,7 @@ addTask( void * vtask ) tr_free( str ); } + curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 60 ); curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1 ); curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16 ); curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1 ); -- 2.40.0