Ignore:
Timestamp:
Mar 2, 2009, 5:48:32 AM (13 years ago)
Author:
charles
Message:

(trunk) #1608: Completed pieces bitfield in rpc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpcimpl.c

    r7888 r7992  
    2525#include "stats.h"
    2626#include "torrent.h"
     27#include "completion.h"
    2728#include "utils.h"
    2829#include "web.h"
     
    425426    else if( !strcmp( key, "peersSendingToUs" ) )
    426427        tr_bencDictAddInt( d, key, st->peersSendingToUs );
     428    else if( !strcmp( key, "pieces" ) ) {
     429        const tr_bitfield * pieces = tr_cpPieceBitfield( &tor->completion );
     430        char * str = tr_base64_encode( pieces->bits, pieces->byteCount, NULL );
     431        tr_bencDictAddStr( d, key, str );
     432        tr_free( str );
     433    }
    427434    else if( !strcmp( key, "pieceCount" ) )
    428435        tr_bencDictAddInt( d, key, inf->pieceCount );
Note: See TracChangeset for help on using the changeset viewer.