(trunk libT) break the mac build and introduce new crashes.

This is partially to address #4145 "Downloads stuck at 100%" by refactoring the bitset, bitfield, and tr_completion; however, the ripple effect is larger than usual so things may get worse in the short term before getting better.

livings124: to fix the mac build, remove bitset.[ch] from xcode
This commit is contained in:
Jordan Lee
2011-03-28 16:31:05 +00:00
parent 1101ba8d57
commit 83c0e4f011
17 changed files with 724 additions and 956 deletions

View File

@@ -558,11 +558,12 @@ addField( const tr_torrent * tor, tr_benc * d, const char * key )
else if( tr_streq( key, keylen, "peersSendingToUs" ) )
tr_bencDictAddInt( d, key, st->peersSendingToUs );
else if( tr_streq( key, keylen, "pieces" ) ) {
tr_bitfield * bf = tr_cpCreatePieceBitfield( &tor->completion );
char * str = tr_base64_encode( bf->bits, bf->byteCount, NULL );
size_t byte_count = 0;
void * bytes = tr_cpCreatePieceBitfield( &tor->completion, &byte_count );
char * str = tr_base64_encode( bytes, byte_count, NULL );
tr_bencDictAddStr( d, key, str!=NULL ? str : "" );
tr_free( str );
tr_bitfieldFree( bf );
tr_free( bytes );
}
else if( tr_streq( key, keylen, "pieceCount" ) )
tr_bencDictAddInt( d, key, inf->pieceCount );