#903: "1.11: Not making use of Tier 2 tracker on Tier 1 error"
This commit is contained in:
parent
ffd70de1b8
commit
ecc8401203
|
@ -225,11 +225,14 @@ publishNewPeers( tr_tracker * t, int allAreSeeds,
|
||||||
static void onReqDone( tr_session * session );
|
static void onReqDone( tr_session * session );
|
||||||
|
|
||||||
static void
|
static void
|
||||||
updateAddresses( tr_tracker * t, long response_code, int * tryAgain )
|
updateAddresses( tr_tracker * t,
|
||||||
|
long response_code,
|
||||||
|
int moveToNextAddress,
|
||||||
|
int * tryAgain )
|
||||||
{
|
{
|
||||||
int moveToNextAddress = FALSE;
|
|
||||||
tr_torrent * torrent = tr_torrentFindFromHash( t->session, t->hash );
|
tr_torrent * torrent = tr_torrentFindFromHash( t->session, t->hash );
|
||||||
|
|
||||||
|
|
||||||
if( !response_code ) /* tracker didn't respond */
|
if( !response_code ) /* tracker didn't respond */
|
||||||
{
|
{
|
||||||
tr_ninf( t->name, _( "Tracker hasn't responded yet. Retrying..." ) );
|
tr_ninf( t->name, _( "Tracker hasn't responded yet. Retrying..." ) );
|
||||||
|
@ -254,7 +257,6 @@ updateAddresses( tr_tracker * t, long response_code, int * tryAgain )
|
||||||
}
|
}
|
||||||
|
|
||||||
*tryAgain = moveToNextAddress;
|
*tryAgain = moveToNextAddress;
|
||||||
|
|
||||||
if( moveToNextAddress )
|
if( moveToNextAddress )
|
||||||
{
|
{
|
||||||
if ( ++t->trackerIndex >= torrent->info.trackerCount ) /* we've tried them all */
|
if ( ++t->trackerIndex >= torrent->info.trackerCount ) /* we've tried them all */
|
||||||
|
@ -326,6 +328,7 @@ onTrackerResponse( tr_session * session,
|
||||||
size_t responseLen,
|
size_t responseLen,
|
||||||
void * torrent_hash )
|
void * torrent_hash )
|
||||||
{
|
{
|
||||||
|
int moveToNextAddress = FALSE;
|
||||||
int tryAgain;
|
int tryAgain;
|
||||||
tr_tracker * t;
|
tr_tracker * t;
|
||||||
|
|
||||||
|
@ -351,8 +354,11 @@ onTrackerResponse( tr_session * session,
|
||||||
int incomplete = -1;
|
int incomplete = -1;
|
||||||
const char * str;
|
const char * str;
|
||||||
|
|
||||||
if(( tr_bencDictFindStr( &benc, "failure reason", &str )))
|
if(( tr_bencDictFindStr( &benc, "failure reason", &str ))) {
|
||||||
publishErrorMessageAndStop( t, str );
|
// publishErrorMessageAndStop( t, str );
|
||||||
|
moveToNextAddress = TRUE;
|
||||||
|
publishMessage( t, str, TR_TRACKER_ERROR );
|
||||||
|
}
|
||||||
|
|
||||||
if(( tr_bencDictFindStr( &benc, "warning message", &str )))
|
if(( tr_bencDictFindStr( &benc, "warning message", &str )))
|
||||||
publishWarning( t, str );
|
publishWarning( t, str );
|
||||||
|
@ -398,7 +404,7 @@ onTrackerResponse( tr_session * session,
|
||||||
tr_bencFree( &benc );
|
tr_bencFree( &benc );
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAddresses( t, responseCode, &tryAgain );
|
updateAddresses( t, responseCode, moveToNextAddress, &tryAgain );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
***
|
***
|
||||||
|
@ -459,6 +465,7 @@ onScrapeResponse( tr_session * session,
|
||||||
size_t responseLen,
|
size_t responseLen,
|
||||||
void * torrent_hash )
|
void * torrent_hash )
|
||||||
{
|
{
|
||||||
|
int moveToNextAddress = FALSE;
|
||||||
int tryAgain;
|
int tryAgain;
|
||||||
tr_tracker * t;
|
tr_tracker * t;
|
||||||
|
|
||||||
|
@ -510,12 +517,14 @@ onScrapeResponse( tr_session * session,
|
||||||
t->retryScrapeIntervalSec = 30;
|
t->retryScrapeIntervalSec = 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
moveToNextAddress = TRUE;
|
||||||
|
|
||||||
if( bencLoaded )
|
if( bencLoaded )
|
||||||
tr_bencFree( &benc );
|
tr_bencFree( &benc );
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAddresses( t, responseCode, &tryAgain );
|
updateAddresses( t, responseCode, moveToNextAddress, &tryAgain );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
***
|
***
|
||||||
|
|
Loading…
Reference in New Issue