1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(trunk, libT) #4638 "Transmission sends an initial 'stopped' event when adding a torrent via RPC" -- fixed.

This commit is contained in:
Jordan Lee 2012-10-15 03:11:16 +00:00
parent da2afd01ef
commit 8fb80f5132

View file

@ -1720,6 +1720,7 @@ torrentRecheckDoneCB( tr_torrent * tor )
static void static void
verifyTorrent( void * vtor ) verifyTorrent( void * vtor )
{ {
bool startAfter;
tr_torrent * tor = vtor; tr_torrent * tor = vtor;
tr_sessionLock( tor->session ); tr_sessionLock( tor->session );
@ -1727,13 +1728,12 @@ verifyTorrent( void * vtor )
/* if the torrent's already being verified, stop it */ /* if the torrent's already being verified, stop it */
tr_verifyRemove( tor ); tr_verifyRemove( tor );
/* if the torrent's running, stop it & set the restart-after-verify flag */ startAfter = (tor->isRunning || tor->startAfterVerify) && !tor->isStopping;
if( tor->startAfterVerify || tor->isRunning ) {
/* don't clobber isStopping */ if( tor->isRunning )
const bool startAfter = tor->isStopping ? false : true;
tr_torrentStop( tor ); tr_torrentStop( tor );
tor->startAfterVerify = startAfter;
} tor->startAfterVerify = startAfter;
if( setLocalErrorIfFilesDisappeared( tor ) ) if( setLocalErrorIfFilesDisappeared( tor ) )
tor->startAfterVerify = false; tor->startAfterVerify = false;