mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 10:42:35 +00:00
create remote bitfield on have message if bitfeild message was never received
This commit is contained in:
1 parent
0c576aa8eb
commit
0b941d8f10
1 file changed
+2
@@ -1201,6 +1201,8 @@ namespace torrents
|
||||
void PeerConnection::HandleHaveMsg (const uint8_t * buf, size_t len)
|
||||
{
|
||||
if (len < 4) return;
|
||||
if (m_RemoteBitfield.empty ()) // bitfield was not received before because was empty
|
||||
m_RemoteBitfield.resize (m_Torrent->GetNumPieces ());
|
||||
uint32_t index = bufbe32toh (buf);
|
||||
if (index < m_RemoteBitfield.size ())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user