Changeset 9240


Ignore:
Timestamp:
Oct 3, 2009, 2:08:05 PM (12 years ago)
Author:
charles
Message:

(trunk libT) remove randOffset from announcer; the new announce queue handles load balancing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r9238 r9240  
    375375    int retryScrapeIntervalSec;
    376376
    377     int randOffset;
    378377    int lastAnnouncePeerCount;
    379378
     
    395394
    396395    t = tr_new0( tr_tier, 1 );
    397     t->randOffset = tor->uniqueId % 60;
    398396    t->key = nextKey++;
    399397    t->trackers = TR_PTR_ARRAY_INIT;
     
    403401    t->announceIntervalSec = DEFAULT_ANNOUNCE_INTERVAL_SEC;
    404402    t->announceMinIntervalSec = DEFAULT_ANNOUNCE_MIN_INTERVAL_SEC;
    405     t->scrapeAt = now + t->randOffset;
     403    t->scrapeAt = now;
    406404    t->tor = tor;
    407405
     
    12311229            dbgmsg( tier, "No response from tracker... retrying in two minutes." );
    12321230            tier->manualAnnounceAllowedAt = ~(time_t)0;
    1233             tierSetNextAnnounce( tier, tier->announceEvent, now + tier->randOffset + 120 );
     1231            tierSetNextAnnounce( tier, tier->announceEvent, now + 120 );
    12341232        }
    12351233        else if( 200 <= responseCode && responseCode <= 299 )
    12361234        {
    1237             const int interval = tier->announceIntervalSec + tier->randOffset;
     1235            const int interval = tier->announceIntervalSec;
    12381236            dbgmsg( tier, "request succeeded. reannouncing in %d seconds", interval );
    12391237
     
    12411239            {
    12421240                tier->lastScrapeTime = now;
    1243                 tier->scrapeAt = now + tier->scrapeIntervalSec + tier->randOffset;
     1241                tier->scrapeAt = now + tier->scrapeIntervalSec;
    12441242            }
    12451243
     
    12801278        {
    12811279            /* WTF did we get?? */
    1282             const int interval = tier->randOffset + 120;
     1280            const int interval = 120;
    12831281            dbgmsg( tier, "Invalid response from tracker... retrying in two minutes." );
    12841282            tier->manualAnnounceAllowedAt = ~(time_t)0;
     
    14461444        if( 200 <= responseCode && responseCode <= 299 )
    14471445        {
    1448             const int interval = tier->scrapeIntervalSec + tier->randOffset;
     1446            const int interval = tier->scrapeIntervalSec;
    14491447            tier->scrapeAt = now + interval;
    14501448
     
    14631461        else
    14641462        {
    1465             const int interval = tier->retryScrapeIntervalSec + tier->randOffset;
     1463            const int interval = tier->retryScrapeIntervalSec;
    14661464            tier->retryScrapeIntervalSec *= 2;
    14671465            tier->scrapeAt = now + interval;
Note: See TracChangeset for help on using the changeset viewer.