#1308: Transmission forgets it's verifying data

This commit is contained in:
Charles Kerr 2008-10-28 15:13:07 +00:00
parent 6bc269d2bc
commit f2a933fb77
3 changed files with 23 additions and 2 deletions

View File

@ -1124,10 +1124,15 @@ torrentStart( tr_torrent * tor,
if( !tor->isRunning )
{
if( reloadProgress )
const int isVerifying = tr_verifyInProgress( tor );
if( !isVerifying && reloadProgress )
tr_torrentLoadResume( tor, TR_FR_PROGRESS, NULL );
tor->isRunning = 1;
tr_verifyAdd( tor, checkAndStartCB );
if( !isVerifying )
tr_verifyAdd( tor, checkAndStartCB );
}
tr_globalUnlock( tor->session );

View File

@ -201,6 +201,20 @@ compareVerifyByTorrent( const void * va,
return a->torrent - b;
}
int
tr_verifyInProgress( const tr_torrent * tor )
{
int found = FALSE;
tr_lock * lock = getVerifyLock( );
tr_lockLock( lock );
found = ( tor == currentNode.torrent )
|| ( tr_list_find( verifyList, tor, compareVerifyByTorrent ) != NULL );
tr_lockUnlock( lock );
return found;
}
void
tr_verifyRemove( tr_torrent * tor )
{

View File

@ -20,4 +20,6 @@ void tr_verifyAdd( tr_torrent * tor,
void tr_verifyRemove( tr_torrent * tor );
int tr_verifyInProgress( const tr_torrent * tor );
#endif