update interest when changing upload-only mode

This commit is contained in:
arvidn 2015-06-16 01:24:35 -04:00
parent 75fa65f922
commit 323af56cc2
4 changed files with 16 additions and 11 deletions

View File

@ -1057,6 +1057,9 @@ namespace libtorrent
, end(m_connections.end()); i != end; ++i) , end(m_connections.end()); i != end; ++i)
{ {
peer_connection* p = (*i); peer_connection* p = (*i);
// we may want to disconnect other upload-only peers
if (p->upload_only())
p->update_interest();
p->cancel_all_requests(); p->cancel_all_requests();
} }
// this is used to try leaving upload only mode periodically // this is used to try leaving upload only mode periodically
@ -1076,6 +1079,8 @@ namespace libtorrent
, end(m_connections.end()); i != end; ++i) , end(m_connections.end()); i != end; ++i)
{ {
peer_connection* p = (*i); peer_connection* p = (*i);
// we may be interested now, or no longer interested
p->update_interest();
p->send_block_requests(); p->send_block_requests();
} }
} }