mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
(trunk libT) #2850 "tr_torrentSetAnnounceList() should not trigger reannounces to trackers" -- further revision to get newly-added tiers to announce
This commit is contained in:
parent
2ad6e06ea6
commit
617e80d767
1 changed files with 17 additions and 5 deletions
|
@ -28,6 +28,8 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "web.h"
|
#include "web.h"
|
||||||
|
|
||||||
|
#define STARTED "started"
|
||||||
|
|
||||||
#define dbgmsg( tier, ... ) \
|
#define dbgmsg( tier, ... ) \
|
||||||
if( tr_deepLoggingIsActive( ) ) do { \
|
if( tr_deepLoggingIsActive( ) ) do { \
|
||||||
char name[128]; \
|
char name[128]; \
|
||||||
|
@ -822,6 +824,9 @@ tr_announcerAddTorrent( tr_announcer * announcer, tr_torrent * tor )
|
||||||
return tiers;
|
return tiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tierAddAnnounce( tr_tier * tier, const char * announceEvent, time_t announceAt );
|
||||||
|
|
||||||
void
|
void
|
||||||
tr_announcerResetTorrent( tr_announcer * announcer, tr_torrent * tor )
|
tr_announcerResetTorrent( tr_announcer * announcer, tr_torrent * tor )
|
||||||
{
|
{
|
||||||
|
@ -871,11 +876,18 @@ tr_announcerResetTorrent( tr_announcer * announcer, tr_torrent * tor )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
/* kickstart any tiers that didn't get started */
|
||||||
|
if( tor->isRunning )
|
||||||
{
|
{
|
||||||
/* start the torrent, if applicable */
|
int i, n;
|
||||||
if( tor->isRunning )
|
const time_t now = tr_time( );
|
||||||
tr_announcerTorrentStarted( tor );
|
tr_tier ** tiers = (tr_tier**) tr_ptrArrayPeek( &tor->tiers->tiers, &n );
|
||||||
|
for( i=0; i<n; ++i ) {
|
||||||
|
tr_tier * tier = tiers[i];
|
||||||
|
if( !tier->isRunning )
|
||||||
|
tierAddAnnounce( tier, STARTED, now );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
|
@ -975,7 +987,7 @@ torrentAddAnnounce( tr_torrent * tor, const char * announceEvent, time_t announc
|
||||||
void
|
void
|
||||||
tr_announcerTorrentStarted( tr_torrent * tor )
|
tr_announcerTorrentStarted( tr_torrent * tor )
|
||||||
{
|
{
|
||||||
torrentAddAnnounce( tor, "started", tr_time( ) );
|
torrentAddAnnounce( tor, STARTED, tr_time( ) );
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
tr_announcerManualAnnounce( tr_torrent * tor )
|
tr_announcerManualAnnounce( tr_torrent * tor )
|
||||||
|
|
Loading…
Reference in a new issue