Changeset 2734


Ignore:
Timestamp:
Aug 13, 2007, 2:35:16 PM (15 years ago)
Author:
charles
Message:

(0.8x) dead code removal. (ticket #286)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.8x/libtransmission/tracker.c

    r2591 r2734  
    9292    int            randOffset;
    9393
    94     tr_flag_t      hasManyPeers;
    9594    tr_flag_t      completelyUnconnectable;
    9695    tr_flag_t      allUnreachIfError;
     
    211210static int shouldConnect( tr_tracker_t * tc )
    212211{
    213     tr_torrent_t * tor = tc->tor;
    214212    const uint64_t now = tr_date();
    215213
     
    267265    {
    268266        return 1;
    269     }
    270 
    271     /* If there is quite a lot of people on this torrent, stress
    272        the tracker a bit until we get a decent number of peers */
    273     if( tc->hasManyPeers &&
    274         (tr_cpGetStatus ( tor->completion ) == TR_CP_INCOMPLETE ))
    275     {
    276         /* reannounce in 10 seconds if we have less than 5 peers */
    277         if( tor->peerCount < 5 )
    278         {
    279             if( now > tc->dateOk + 1000 * MAX( 10, tc->minInterval ) )
    280             {
    281                 return 1;
    282             }
    283         }
    284         /* reannounce in 20 seconds if we have less than 10 peers */
    285         else if( tor->peerCount < 10 )
    286         {
    287             if( now > tc->dateOk + 1000 * MAX( 20, tc->minInterval ) )
    288             {
    289                 return 1;
    290             }
    291         }
    292         /* reannounce in 30 seconds if we have less than 15 peers */
    293         else if( tor->peerCount < 15 )
    294         {
    295             if( now > tc->dateOk + 1000 * MAX( 30, tc->minInterval ) )
    296             {
    297                 return 1;
    298             }
    299         }
    300267    }
    301268
     
    812779
    813780    tc->scrapeNeeded = scrapeNeeded;
    814     if( !scrapeNeeded )
    815     {
    816         tc->hasManyPeers = ( tc->seeders + tc->leechers >= 50 );
    817     }
    818781
    819782    beFoo = tr_bencDictFind( &beAll, "tracker id" );
     
    859822    {
    860823        tr_inf( "Tracker: got %d peers", peerCount );
    861         if( peerCount >= 50 )
    862         {
    863             tc->hasManyPeers = 1;
    864         }
    865824        *_peerCount = peerCount;
    866825        *_peerCompact = peerCompact;
     
    1006965    }
    1007966   
    1008     tc->hasManyPeers = ( tc->seeders + tc->leechers >= 50 );
    1009    
    1010967    tr_bencFree( &scrape );
    1011968}
Note: See TracChangeset for help on using the changeset viewer.