get rid of the "tracker hasn't responded yet" message because it drives users insane

This commit is contained in:
Charles Kerr 2008-02-29 06:28:00 +00:00
parent a7d087b60a
commit a6d464347d
1 changed files with 4 additions and 22 deletions

View File

@ -288,17 +288,13 @@ parseBencResponse( struct evhttp_request * req, tr_benc * setme )
return tr_bencLoad( body, bodylen, setme, NULL ); return tr_bencLoad( body, bodylen, setme, NULL );
} }
static const char* static void
updateAddresses( tr_tracker * t, const struct evhttp_request * req, int * tryAgain ) updateAddresses( tr_tracker * t, const struct evhttp_request * req, int * tryAgain )
{ {
const char * ret = NULL;
int moveToNextAddress = FALSE; int moveToNextAddress = FALSE;
if( !req ) if( !req ) /* tracker didn't respond */
{ {
ret = "Tracker hasn't responded yet. Retrying...";
tr_inf( ret );
moveToNextAddress = TRUE; moveToNextAddress = TRUE;
} }
else if( req->response_code == HTTP_OK ) else if( req->response_code == HTTP_OK )
@ -351,13 +347,8 @@ updateAddresses( tr_tracker * t, const struct evhttp_request * req, int * tryAga
{ {
*tryAgain = FALSE; *tryAgain = FALSE;
t->addressIndex = 0; t->addressIndex = 0;
ret = "Tracker hasn't responded yet. Retrying...";
tr_inf( ret );
} }
} }
return ret;
} }
/* Convert to compact form */ /* Convert to compact form */
@ -402,7 +393,6 @@ parseOldPeers( tr_benc * bePeers, int * setmePeerCount )
static void static void
onTrackerResponse( struct evhttp_request * req, void * vhash ) onTrackerResponse( struct evhttp_request * req, void * vhash )
{ {
const char * warning;
int tryAgain; int tryAgain;
int responseCode; int responseCode;
struct torrent_hash * torrent_hash = (struct torrent_hash*) vhash; struct torrent_hash * torrent_hash = (struct torrent_hash*) vhash;
@ -495,10 +485,7 @@ onTrackerResponse( struct evhttp_request * req, void * vhash )
tr_bencFree( &benc ); tr_bencFree( &benc );
} }
if (( warning = updateAddresses( t, req, &tryAgain ) )) { updateAddresses( t, req, &tryAgain );
publishWarning( t, warning );
tr_err( warning );
}
/** /**
*** ***
@ -569,7 +556,6 @@ onTrackerResponse( struct evhttp_request * req, void * vhash )
static void static void
onScrapeResponse( struct evhttp_request * req, void * vhash ) onScrapeResponse( struct evhttp_request * req, void * vhash )
{ {
const char * warning;
int tryAgain; int tryAgain;
time_t nextScrapeSec = 60; time_t nextScrapeSec = 60;
struct torrent_hash * torrent_hash = (struct torrent_hash*) vhash; struct torrent_hash * torrent_hash = (struct torrent_hash*) vhash;
@ -638,11 +624,7 @@ onScrapeResponse( struct evhttp_request * req, void * vhash )
tr_bencFree( &benc ); tr_bencFree( &benc );
} }
if (( warning = updateAddresses( t, req, &tryAgain ) )) updateAddresses( t, req, &tryAgain );
{
tr_err( warning );
publishWarning( t, warning );
}
if( tryAgain ) if( tryAgain )
t->scrapeAt = time( NULL ); t->scrapeAt = time( NULL );