forked from premiere/premiere-libtorrent
fix to faster unchoke a new peer if an unchoked peer becomes uninterested
This commit is contained in:
parent
9bcd5be3fc
commit
8b835bf75f
|
@ -1158,6 +1158,18 @@ namespace libtorrent
|
|||
boost::shared_ptr<torrent> t = m_torrent.lock();
|
||||
TORRENT_ASSERT(t);
|
||||
|
||||
if (!is_choked())
|
||||
{
|
||||
if (m_peer_info && m_peer_info->optimistically_unchoked)
|
||||
{
|
||||
m_peer_info->optimistically_unchoked = false;
|
||||
m_ses.m_optimistic_unchoke_time_scaler = 0;
|
||||
}
|
||||
t->choke_peer(*this);
|
||||
--m_ses.m_num_unchoked;
|
||||
m_ses.m_unchoke_time_scaler = 0;
|
||||
}
|
||||
|
||||
t->get_policy().not_interested(*this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue