don't send bitfield to peers whose handshake we haven't fully received yet (#925)

This commit is contained in:
Arvid Norberg 2016-07-20 10:11:28 -07:00 committed by GitHub
parent e75bb120b4
commit 5bda955f8f
1 changed files with 5 additions and 1 deletions

View File

@ -270,6 +270,11 @@ namespace libtorrent
disconnect_if_redundant();
if (m_disconnecting) return;
if (!m_sent_handshake) return;
// we haven't gotten far enough on the incoming handshake to be able to
// send the bitfield yet
if (m_state < read_packet_size) return;
// connections that are still in the handshake
// will send their bitfield when the handshake
// is done
@ -277,7 +282,6 @@ namespace libtorrent
write_upload_only();
#endif
if (!m_sent_handshake) return;
if (m_sent_bitfield) return;
boost::shared_ptr<torrent> t = associated_torrent().lock();
TORRENT_ASSERT(t);