bandwidth limiter fixes. proper priority that cannot starve connections

This commit is contained in:
Arvid Norberg
2008-01-17 17:40:46 +00:00
parent c69fa07e2d
commit 127d3e6ad5
12 changed files with 219 additions and 166 deletions

View File

@@ -1434,9 +1434,9 @@ namespace detail
if (m_settings.auto_upload_slots && upload_limit != bandwidth_limit::inf)
{
// if our current upload rate is less than 90% of our
// limit AND most torrents are not "congested", i.e.
// they are not holding back because of a per-torrent
// limit
// limit AND most torrents are not "congested", i.e.
// they are not holding back because of a per-torrent
// limit
if (m_stat.upload_rate() < upload_limit * 0.9f
&& m_allowed_upload_slots <= m_num_unchoked + 1
&& congested_torrents < uncongested_torrents)
@@ -2042,6 +2042,9 @@ namespace detail
s.num_unchoked = m_num_unchoked;
s.allowed_upload_slots = m_allowed_upload_slots;
s.up_bandwidth_queue = m_upload_channel.queue_size();
s.down_bandwidth_queue = m_download_channel.queue_size();
s.has_incoming_connections = m_incoming_connection;
s.download_rate = m_stat.download_rate();