Changeset 1555


Ignore:
Timestamp:
Mar 9, 2007, 1:43:10 AM (15 years ago)
Author:
joshe
Message:

Send the correct bitfield in the bitfield message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peermessages.h

    r1447 r1555  
    251251static void sendBitfield( tr_torrent_t * tor, tr_peer_t * peer )
    252252{
    253     uint8_t * p;
    254     int       bitfieldSize = ( tor->info.pieceCount + 7 ) / 8;
    255 
    256     p = getMessagePointer( peer, bitfieldSize, PEER_MSG_BITFIELD );
    257 
    258     memcpy( p, tr_cpPieceBitfield( tor->completion ), bitfieldSize );
     253    uint8_t       * p;
     254    tr_bitfield_t * bitfield;
     255
     256    bitfield = tr_cpPieceBitfield( tor->completion );
     257    p = getMessagePointer( peer, bitfield->len, PEER_MSG_BITFIELD );
     258
     259    memcpy( p, bitfield->bits, bitfield->len );
    259260
    260261    peer_dbg( "SEND bitfield" );
Note: See TracChangeset for help on using the changeset viewer.