Changeset 4213
- Timestamp:
- Dec 19, 2007, 5:57:55 AM (14 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 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 -
trunk/libtransmission/utils.c
r4111 r4213 699 699 assert( a->len == b->len ); 700 700 701 for( ait=a->bits, bit=b->bits, aend=ait+a->len; ait!=aend; ++ait, ++bit)702 *ait |= *bit;701 for( ait=a->bits, bit=b->bits, aend=ait+a->len; ait!=aend; ) 702 *ait++ |= *bit++; 703 703 704 704 return a;
Note: See TracChangeset
for help on using the changeset viewer.