Changeset 4213 for trunk/libtransmission/torrent.c
- Timestamp:
- Dec 19, 2007, 5:57:55 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r4209 r4213 791 791 { 792 792 int i; 793 tr_bitfield * available = tr_peerMgrGetAvailable( tor->handle->peerMgr,794 tor->info.hash );793 tr_bitfield * availablePieces = tr_peerMgrGetAvailable( tor->handle->peerMgr, 794 tor->info.hash ); 795 795 s->desiredSize = 0; 796 796 s->desiredAvailable = 0; … … 798 798 for( i=0; i<tor->info.pieceCount; ++i ) { 799 799 if( !tor->info.pieces[i].dnd ) { 800 s->desiredSize += tr_torPieceCountBytes( tor, i ); 801 if( tr_bitfieldHas( available, i ) ) 802 s->desiredAvailable += tr_torPieceCountBytes( tor, i ); 800 const uint64_t byteCount = tr_torPieceCountBytes( tor, i ); 801 s->desiredSize += byteCount; 802 if( tr_bitfieldHas( availablePieces, i ) ) 803 s->desiredAvailable += byteCount; 803 804 } 804 805 } 805 806 806 tr_bitfieldFree( available ); 807 /* "availablePieces" can miss our unverified blocks... */ 808 if( s->desiredAvailable < s->haveValid + s->haveUnchecked ) 809 s->desiredAvailable = s->haveValid + s->haveUnchecked; 810 811 tr_bitfieldFree( availablePieces ); 807 812 } 808 813
Note: See TracChangeset
for help on using the changeset viewer.