optimistic unchoke fix

This commit is contained in:
Arvid Norberg
2010-10-04 04:06:14 +00:00
parent e1948fa203
commit 440abdfaf2
3 changed files with 18 additions and 7 deletions

View File

@@ -2807,11 +2807,19 @@ namespace aux {
if (!pi->optimistically_unchoked)
{
torrent* t = pi->connection->associated_torrent().lock().get();
bool ret = t->unchoke_peer(*pi->connection);
bool ret = t->unchoke_peer(*pi->connection, true);
TORRENT_ASSERT(ret);
pi->optimistically_unchoked = true;
++m_num_unchoked;
pi->last_optimistically_unchoked = session_time();
if (ret)
{
pi->optimistically_unchoked = true;
++m_num_unchoked;
pi->last_optimistically_unchoked = session_time();
}
else
{
// we failed to unchoke it, increment the count again
++num_opt_unchoke;
}
}
}
else