disconnect redundant fix

This commit is contained in:
Arvid Norberg 2009-08-02 00:05:41 +00:00
parent 78a6df0b2a
commit 5d76c19168
1 changed files with 2 additions and 1 deletions

View File

@ -1577,7 +1577,8 @@ namespace libtorrent
if (!m_ses.settings().close_redundant_connections) return;
boost::shared_ptr<torrent> t = m_torrent.lock();
TORRENT_ASSERT(t);
if (!t) return;
if (m_upload_only && t->is_finished())
{
disconnect(error_code(errors::upload_upload_connection, libtorrent_category));