fix to immediately unchoke another peer if an unchoked peer is disconnected

This commit is contained in:
Arvid Norberg 2008-10-14 01:00:05 +00:00
parent c709cd28a8
commit cb1fce0d62
1 changed files with 8 additions and 0 deletions

View File

@ -2092,7 +2092,15 @@ namespace libtorrent
}
if (!p->is_choked())
{
--m_num_uploads;
m_ses.m_unchoke_time_scaler = 0;
}
if (p->peer_info_struct() && p->peer_info_struct()->optimistically_unchoked)
{
m_ses.m_optimistic_unchoke_time_scaler = 0;
}
m_policy.connection_closed(*p);
p->set_peer_info(0);