Changeset 10195


Ignore:
Timestamp:
Feb 14, 2010, 3:40:39 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #2850 "tr_torrentSetAnnounceList() should not trigger reannounces to trackers" -- further revision to get newly-added tiers to announce

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r10194 r10195  
    2828#include "utils.h"
    2929#include "web.h"
     30
     31#define STARTED "started"
    3032
    3133#define dbgmsg( tier, ... ) \
     
    823825}
    824826
     827static void
     828tierAddAnnounce( tr_tier * tier, const char * announceEvent, time_t announceAt );
     829
    825830void
    826831tr_announcerResetTorrent( tr_announcer * announcer, tr_torrent * tor )
     
    872877        }
    873878    }
    874     else
    875     {
    876         /* start the torrent, if applicable */
    877         if( tor->isRunning )
    878             tr_announcerTorrentStarted( tor );
     879
     880    /* kickstart any tiers that didn't get started */
     881    if( tor->isRunning )
     882    {
     883        int i, n;
     884        const time_t now = tr_time( );
     885        tr_tier ** tiers = (tr_tier**) tr_ptrArrayPeek( &tor->tiers->tiers, &n );
     886        for( i=0; i<n; ++i ) {
     887            tr_tier * tier = tiers[i];
     888            if( !tier->isRunning )   
     889                tierAddAnnounce( tier, STARTED, now );
     890        }
    879891    }
    880892
     
    976988tr_announcerTorrentStarted( tr_torrent * tor )
    977989{
    978     torrentAddAnnounce( tor, "started", tr_time( ) );
     990    torrentAddAnnounce( tor, STARTED, tr_time( ) );
    979991}
    980992void
Note: See TracChangeset for help on using the changeset viewer.