mirror of
https://github.com/transmission/transmission
synced 2025-02-04 05:22:40 +00:00
(trunk libT) #2636: "wrong peer progress update" -- possible fix as described in comment:2
This commit is contained in:
parent
f1da30ceb3
commit
7537f02589
1 changed files with 8 additions and 3 deletions
|
@ -1434,12 +1434,17 @@ readBtMessage( tr_peermsgs * msgs, struct evbuffer * inbuf, size_t inlen )
|
|||
updatePeerProgress( msgs );
|
||||
break;
|
||||
|
||||
case BT_BITFIELD:
|
||||
case BT_BITFIELD: {
|
||||
const size_t bitCount = tr_torrentHasMetadata( msgs->torrent )
|
||||
? msgs->torrent->info.pieceCount
|
||||
: msglen * 8;
|
||||
dbgmsg( msgs, "got a bitfield" );
|
||||
tr_bitsetReserve( &msgs->peer->have, msglen*8 );
|
||||
tr_peerIoReadBytes( msgs->peer->io, inbuf, msgs->peer->have.bitfield.bits, msglen );
|
||||
tr_bitsetReserve( &msgs->peer->have, bitCount );
|
||||
tr_peerIoReadBytes( msgs->peer->io, inbuf,
|
||||
msgs->peer->have.bitfield.bits, msglen );
|
||||
updatePeerProgress( msgs );
|
||||
break;
|
||||
}
|
||||
|
||||
case BT_REQUEST:
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue