From a31134d4a482c8e3eb00e9cd22f8ad47cf9642ce Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 10 Feb 2012 07:31:40 +0000 Subject: [PATCH] fix some invariant check failures in metadata transfer edge cases --- src/bt_peer_connection.cpp | 1 + src/peer_connection.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 1eed9156b..feea2bbd6 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -1617,6 +1617,7 @@ namespace libtorrent if (extended_id == 0) { on_extended_handshake(); + disconnect_if_redundant(); return; } diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index de30ac308..68bddf9e8 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -829,6 +829,9 @@ namespace libtorrent on_metadata(); if (m_disconnecting) return; + disconnect_if_redundant(); + if (m_disconnecting) return; + // let the torrent know which pieces the // peer has // if we're a seed, we don't keep track of piece availability