(trunk libT) #3258 "Transmission 1.93 sends 'stopped'+'started' announce instead of 'completed' if the incomplete-dir is enabled" -- probable fix

This commit is contained in:
Charles Kerr 2010-06-03 16:37:50 +00:00
parent 149549f3c5
commit 60ce7e5263
2 changed files with 15 additions and 10 deletions

View File

@ -1536,13 +1536,19 @@ getNextAnnounceEvent( tr_tier * tier )
assert( tier != NULL );
assert( tr_isTorrent( tier->tor ) );
/* special case #1: if "stopped" is in the queue, ignore everything before it */
events = (const char**) tr_ptrArrayPeek( &tier->announceEvents, &n );
/* special case #1: if "stopped" is in the queue,
* ignore everything before it except "completed" */
if( pos == -1 ) {
for( i=0; i<n; ++i )
tr_bool completed = FALSE;
for( i = 0; i < n; ++i ) {
if( !strcmp( events[i], "completed" ) )
completed = TRUE;
if( !strcmp( events[i], "stopped" ) )
break;
if( i < n )
}
if( !completed && ( i < n ) )
pos = i;
}

View File

@ -1723,6 +1723,12 @@ tr_torrentRecheckCompleteness( tr_torrent * tor )
if( tr_torrentIsSeed( tor ) )
{
if( recentChange )
{
tr_announcerTorrentCompleted( tor );
tor->doneDate = tor->anyDate = tr_time( );
}
tr_torrentCheckSeedRatio( tor );
if( tor->currentDir == tor->incompleteDir )
@ -1734,13 +1740,6 @@ tr_torrentRecheckCompleteness( tr_torrent * tor )
fireCompletenessChange( tor, completeness );
if( recentChange && tr_torrentIsSeed( tor ) )
{
tr_announcerTorrentCompleted( tor );
tor->doneDate = tor->anyDate = tr_time( );
}
tr_torrentSetDirty( tor );
}