lt sync 2836

This commit is contained in:
Andrew Resch 2008-10-18 23:57:39 +00:00
parent 3405450256
commit 79209daf94
2 changed files with 13 additions and 1 deletions

View File

@ -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);
}

View File

@ -1129,7 +1129,7 @@ namespace libtorrent
if (new_piece_priority == int(p.piece_priority)) return false;
int prev_priority = p.priority(this);
TORRENT_ASSERT(m_dirty | prev_priority < int(m_priority_boundries.size()));
TORRENT_ASSERT(m_dirty || prev_priority < int(m_priority_boundries.size()));
bool ret = false;
if (new_piece_priority == piece_pos::filter_priority