Changeset 9659


Ignore:
Timestamp:
Dec 3, 2009, 3:11:22 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #2636: "wrong peer progress update" -- possible fix as described in comment:2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r9596 r9659  
    14351435            break;
    14361436
    1437         case BT_BITFIELD:
     1437        case BT_BITFIELD: {
     1438            const size_t bitCount = tr_torrentHasMetadata( msgs->torrent )
     1439                                  ? msgs->torrent->info.pieceCount
     1440                                  : msglen * 8;
    14381441            dbgmsg( msgs, "got a bitfield" );
    1439             tr_bitsetReserve( &msgs->peer->have, msglen*8 );
    1440             tr_peerIoReadBytes( msgs->peer->io, inbuf, msgs->peer->have.bitfield.bits, msglen );
     1442            tr_bitsetReserve( &msgs->peer->have, bitCount );
     1443            tr_peerIoReadBytes( msgs->peer->io, inbuf,
     1444                                msgs->peer->have.bitfield.bits, msglen );
    14411445            updatePeerProgress( msgs );
    14421446            break;
     1447        }
    14431448
    14441449        case BT_REQUEST:
Note: See TracChangeset for help on using the changeset viewer.