separated bandwidth_manager into bandwidht_limit and bandwidth_queue_entry and fixed problems related to #225

This commit is contained in:
Arvid Norberg
2007-12-31 09:41:50 +00:00
parent 62670cc2f3
commit ddf16fb3bb
8 changed files with 456 additions and 154 deletions

View File

@@ -2916,6 +2916,12 @@ namespace libtorrent
#ifndef NDEBUG
void peer_connection::check_invariant() const
{
for (int i = 0; i < 2; ++i)
{
// this peer is in the bandwidth history iff max_assignable < limit
TORRENT_ASSERT((m_bandwidth_limit[i].max_assignable() < m_bandwidth_limit[i].throttle())
== m_ses.m_bandwidth_manager[i]->is_in_history(this));
}
if (m_peer_info)
{
TORRENT_ASSERT(m_peer_info->connection == this