more disconnect handling for upload-only

This commit is contained in:
Arvid Norberg 2008-09-07 10:00:58 +00:00
parent e8a0ace739
commit a61c1ee01d
1 changed files with 4 additions and 0 deletions

View File

@ -1173,6 +1173,8 @@ namespace libtorrent
<< " <== HAVE [ piece: " << index << "]\n"; << " <== HAVE [ piece: " << index << "]\n";
#endif #endif
if (is_disconnecting()) return;
if (!t->valid_metadata() && index > int(m_have_piece.size())) if (!t->valid_metadata() && index > int(m_have_piece.size()))
{ {
if (index < 65536) if (index < 65536)
@ -1387,6 +1389,7 @@ namespace libtorrent
// if we haven't received a bitfield, it was // if we haven't received a bitfield, it was
// probably omitted, which is the same as 'have_none' // probably omitted, which is the same as 'have_none'
if (!m_bitfield_received) incoming_have_none(); if (!m_bitfield_received) incoming_have_none();
if (is_disconnecting()) return;
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin() for (extension_list_t::iterator i = m_extensions.begin()
@ -1593,6 +1596,7 @@ namespace libtorrent
// if we haven't received a bitfield, it was // if we haven't received a bitfield, it was
// probably omitted, which is the same as 'have_none' // probably omitted, which is the same as 'have_none'
if (!m_bitfield_received) incoming_have_none(); if (!m_bitfield_received) incoming_have_none();
if (is_disconnecting()) return;
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin() for (extension_list_t::iterator i = m_extensions.begin()