fix some invariant check failures in metadata transfer edge cases

This commit is contained in:
Arvid Norberg 2012-02-10 07:31:40 +00:00
parent c384d00dbf
commit a31134d4a4
2 changed files with 4 additions and 0 deletions

View File

@ -1617,6 +1617,7 @@ namespace libtorrent
if (extended_id == 0) if (extended_id == 0)
{ {
on_extended_handshake(); on_extended_handshake();
disconnect_if_redundant();
return; return;
} }

View File

@ -829,6 +829,9 @@ namespace libtorrent
on_metadata(); on_metadata();
if (m_disconnecting) return; if (m_disconnecting) return;
disconnect_if_redundant();
if (m_disconnecting) return;
// let the torrent know which pieces the // let the torrent know which pieces the
// peer has // peer has
// if we're a seed, we don't keep track of piece availability // if we're a seed, we don't keep track of piece availability