(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:
parent
22945b6f35
commit
6f54cb01e6
|
@ -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 )))
|
||||
|
|
Loading…
Reference in New Issue