From a61c1ee01d6d55ce25fd6c4f7f0ca47330a4bbe1 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 7 Sep 2008 10:00:58 +0000 Subject: [PATCH] more disconnect handling for upload-only --- src/peer_connection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 138a21b46..5ce04bcf4 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1173,6 +1173,8 @@ namespace libtorrent << " <== HAVE [ piece: " << index << "]\n"; #endif + if (is_disconnecting()) return; + if (!t->valid_metadata() && index > int(m_have_piece.size())) { if (index < 65536) @@ -1387,6 +1389,7 @@ namespace libtorrent // if we haven't received a bitfield, it was // probably omitted, which is the same as 'have_none' if (!m_bitfield_received) incoming_have_none(); + if (is_disconnecting()) return; #ifndef TORRENT_DISABLE_EXTENSIONS for (extension_list_t::iterator i = m_extensions.begin() @@ -1593,6 +1596,7 @@ namespace libtorrent // if we haven't received a bitfield, it was // probably omitted, which is the same as 'have_none' if (!m_bitfield_received) incoming_have_none(); + if (is_disconnecting()) return; #ifndef TORRENT_DISABLE_EXTENSIONS for (extension_list_t::iterator i = m_extensions.begin()