mirror of
https://github.com/transmission/transmission.git
synced 2026-04-28 04:34:02 +01:00
(trunk libT) #4048 "use bitsets instead of bitfield in tr_completion" -- done.
Excuse the sprawl. Much of this didn't fit into self-contained commits.
This commit is contained in:
@@ -561,10 +561,11 @@ 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" ) ) {
|
||||
const tr_bitfield * pieces = tr_cpPieceBitfield( &tor->completion );
|
||||
char * str = tr_base64_encode( pieces->bits, pieces->byteCount, NULL );
|
||||
tr_bitfield * bf = tr_cpCreatePieceBitfield( &tor->completion );
|
||||
char * str = tr_base64_encode( bf->bits, bf->byteCount, NULL );
|
||||
tr_bencDictAddStr( d, key, str!=NULL ? str : "" );
|
||||
tr_free( str );
|
||||
tr_bitfieldFree( bf );
|
||||
}
|
||||
else if( tr_streq( key, keylen, "pieceCount" ) )
|
||||
tr_bencDictAddInt( d, key, inf->pieceCount );
|
||||
|
||||
Reference in New Issue
Block a user