(trunk) dead code removal. (ticket #286)
This commit is contained in:
parent
9acf79d665
commit
d2ddd4cb4e
|
@ -91,7 +91,6 @@ struct tr_tracker_s
|
|||
int complete;
|
||||
int randOffset;
|
||||
|
||||
tr_flag_t hasManyPeers;
|
||||
tr_flag_t completelyUnconnectable;
|
||||
tr_flag_t allUnreachIfError;
|
||||
tr_flag_t lastError;
|
||||
|
@ -210,7 +209,6 @@ tr_trackerCanManualAnnounce( const tr_tracker_t * tc )
|
|||
|
||||
static int shouldConnect( tr_tracker_t * tc )
|
||||
{
|
||||
tr_torrent_t * tor = tc->tor;
|
||||
const uint64_t now = tr_date();
|
||||
|
||||
/* User has requested a manual announce
|
||||
|
@ -268,37 +266,6 @@ static int shouldConnect( tr_tracker_t * tc )
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* If there is quite a lot of people on this torrent, stress
|
||||
the tracker a bit until we get a decent number of peers */
|
||||
if( tc->hasManyPeers &&
|
||||
(tr_cpGetStatus ( tor->completion ) == TR_CP_INCOMPLETE ))
|
||||
{
|
||||
/* reannounce in 10 seconds if we have less than 5 peers */
|
||||
if( tor->peerCount < 5 )
|
||||
{
|
||||
if( now > tc->dateOk + 1000 * MAX( 10, tc->minInterval ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/* reannounce in 20 seconds if we have less than 10 peers */
|
||||
else if( tor->peerCount < 10 )
|
||||
{
|
||||
if( now > tc->dateOk + 1000 * MAX( 20, tc->minInterval ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/* reannounce in 30 seconds if we have less than 15 peers */
|
||||
else if( tor->peerCount < 15 )
|
||||
{
|
||||
if( now > tc->dateOk + 1000 * MAX( 30, tc->minInterval ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -811,10 +778,6 @@ static void readAnswer( tr_tracker_t * tc, const char * data, int len,
|
|||
}
|
||||
|
||||
tc->scrapeNeeded = scrapeNeeded;
|
||||
if( !scrapeNeeded )
|
||||
{
|
||||
tc->hasManyPeers = ( tc->seeders + tc->leechers >= 50 );
|
||||
}
|
||||
|
||||
beFoo = tr_bencDictFind( &beAll, "tracker id" );
|
||||
if( beFoo )
|
||||
|
@ -858,10 +821,6 @@ static void readAnswer( tr_tracker_t * tc, const char * data, int len,
|
|||
if( peerCount > 0 )
|
||||
{
|
||||
tr_inf( "Tracker: got %d peers", peerCount );
|
||||
if( peerCount >= 50 )
|
||||
{
|
||||
tc->hasManyPeers = 1;
|
||||
}
|
||||
*_peerCount = peerCount;
|
||||
*_peerCompact = peerCompact;
|
||||
}
|
||||
|
@ -1005,8 +964,6 @@ static void readScrapeAnswer( tr_tracker_t * tc, const char * data, int len )
|
|||
}
|
||||
}
|
||||
|
||||
tc->hasManyPeers = ( tc->seeders + tc->leechers >= 50 );
|
||||
|
||||
tr_bencFree( &scrape );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue