* Making a DownloadConstructor to replace src/parse/* stuff.

* Enabled throttle dependent global upload limit and added some stats
display to the client.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@584 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-10-22 19:36:38 +00:00
parent 45781e8dbf
commit dc2b1aa5d8
3 changed files with 19 additions and 4 deletions
+12 -1
View File
@@ -123,7 +123,18 @@ void
Root::receive_up_throttle(int t) {
m_windowStatusbar->mark_dirty();
torrent::set_up_throttle(torrent::get_up_throttle() + t * 1024);
uint32_t throttle = std::max<int>(torrent::get_up_throttle() + t * 1024, 0);
torrent::set_up_throttle(throttle);
if (throttle == 0)
torrent::set_max_unchoked(0);
else if (throttle <= 10 << 10)
torrent::set_max_unchoked(1 + throttle / (1 << 10));
else
torrent::set_max_unchoked(10 + throttle / (5 << 10));
}
}