disconnect_if_redundant fix

This commit is contained in:
Arvid Norberg 2008-11-01 10:14:11 +00:00
parent da9a5c4262
commit 44e9ff70de
1 changed files with 6 additions and 0 deletions

View File

@ -1380,13 +1380,19 @@ namespace libtorrent
boost::shared_ptr<torrent> t = m_torrent.lock();
TORRENT_ASSERT(t);
if (m_upload_only && t->is_finished())
{
disconnect("seed to seed");
return;
}
if (m_upload_only
&& !m_interesting
&& m_bitfield_received
&& t->are_files_checked())
{
disconnect("uninteresting upload-only peer");
return;
}
}
// -----------------------------