Changeset 11468
- Timestamp:
- Dec 5, 2010, 6:38:08 PM (12 years ago)
- Location:
- branches/2.0x/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0x/libtransmission/peer-mgr.c
r10894 r11468 2380 2380 **/ 2381 2381 2382 void 2383 tr_peerMgrClearInterest( tr_torrent * tor ) 2384 { 2385 int i; 2386 Torrent * t; 2387 int peerCount; 2388 2389 assert( tr_isTorrent( tor ) ); 2390 2391 t = tor->torrentPeers; 2392 2393 torrentLock( t ); 2394 2395 peerCount = tr_ptrArraySize( &t->peers ); 2396 2397 for( i=0; i<peerCount; ++i ) 2398 { 2399 const tr_peer * peer = tr_ptrArrayNth( &t->peers, i ); 2400 tr_peerMsgsSetInterested( peer->msgs, FALSE ); 2401 } 2402 2403 torrentUnlock( t ); 2404 } 2405 2382 2406 /* do we still want this piece and does the peer have it? */ 2383 2407 static tr_bool -
branches/2.0x/libtransmission/peer-mgr.h
r10751 r11468 237 237 tr_direction direction ); 238 238 239 void tr_peerMgrClearInterest( tr_torrent * tor ); 240 239 241 /* @} */ 240 242 -
branches/2.0x/libtransmission/torrent.c
r10997 r11468 1476 1476 /* if the torrent's running, stop it & set the restart-after-verify flag */ 1477 1477 if( tor->startAfterVerify || tor->isRunning ) { 1478 /* don't clobber isStopping */ 1479 const tr_bool startAfter = tor->isStopping ? FALSE : TRUE; 1478 1480 tr_torrentStop( tor ); 1479 tor->startAfterVerify = TRUE;1481 tor->startAfterVerify = startAfter; 1480 1482 } 1481 1483 … … 1701 1703 tr_torrentRecheckCompleteness( tr_torrent * tor ) 1702 1704 { 1703 tr_bool wasRunning;1704 1705 tr_completeness completeness; 1705 1706 … … 1709 1710 1710 1711 completeness = tr_cpGetStatus( &tor->completion ); 1711 wasRunning = tor->isRunning;1712 1712 1713 1713 if( completeness != tor->completeness ) 1714 1714 { 1715 1715 const int recentChange = tor->downloadedCur != 0; 1716 const tr_bool wasLeeching = !tr_torrentIsSeed( tor ); 1717 const tr_bool wasRunning = tor->isRunning; 1716 1718 1717 1719 if( recentChange ) … … 1731 1733 tr_announcerTorrentCompleted( tor ); 1732 1734 tor->doneDate = tor->anyDate = tr_time( ); 1735 } 1736 1737 if( wasLeeching && wasRunning ) 1738 { 1739 /* clear interested flag on all peers */ 1740 tr_peerMgrClearInterest( tor ); 1741 1742 /* if completeness was TR_LEECH then the seed limit check will have been skipped in bandwidthPulse */ 1743 tr_torrentCheckSeedRatio( tor ); 1733 1744 } 1734 1745
Note: See TracChangeset
for help on using the changeset viewer.