(trunk libT) #2552 "torrent state doesn't change automatically anymore" new version of r9482 that doesn't have the problems pointed out in #2557

This commit is contained in:
Charles Kerr 2009-11-09 06:36:47 +00:00
parent 22945b6f35
commit 6f54cb01e6
1 changed files with 12 additions and 0 deletions

View File

@ -165,6 +165,7 @@ typedef struct tr_torrent_peers
//int * pendingRequestCount;
tr_bool isRunning;
tr_bool needsCompletenessCheck;
struct block_request * requests;
int requestsSort;
@ -1383,6 +1384,8 @@ peerCallbackFunc( void * vpeer, void * vevent, void * vt )
pieceListRemovePiece( t, p );
}
}
t->needsCompletenessCheck = TRUE;
}
break;
}
@ -2883,6 +2886,15 @@ bandwidthPulse( void * vmgr )
}
}
/* run the completeness check for any torrents that need it */
tor = NULL;
while(( tor = tr_torrentNext( mgr->session, tor ))) {
if( tor->torrentPeers->needsCompletenessCheck ) {
tor->torrentPeers->needsCompletenessCheck = FALSE;
tr_torrentRecheckCompleteness( tor );
}
}
/* possibly stop torrents that have an error */
tor = NULL;
while(( tor = tr_torrentNext( mgr->session, tor )))