Adding controls for download throttle.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@426 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-05-02 01:20:51 +00:00
parent 98676e5531
commit d898b9db01
7 changed files with 70 additions and 32 deletions
+16 -9
View File
@@ -43,17 +43,24 @@ WindowStatusbar::redraw() {
m_canvas->erase();
int pos = 0;
char buf[128];
if (torrent::get(torrent::THROTTLE_ROOT_CONST_RATE) == 0)
m_canvas->print(0, 0, "Throttle: off Listen: %s:%i Handshakes: %i",
m_core->get_dns().empty() ? "<default>" : m_core->get_dns().c_str(),
(int)torrent::get(torrent::LISTEN_PORT),
(int)torrent::get(torrent::HANDSHAKES_TOTAL));
pos = snprintf(buf, 128, "off/");
else
m_canvas->print(0, 0, "Throttle: %i Listen: %s:%i Handshakes: %i",
(int)torrent::get(torrent::THROTTLE_ROOT_CONST_RATE) / 1024,
m_core->get_dns().empty() ? "<default>" : m_core->get_dns().c_str(),
(int)torrent::get(torrent::LISTEN_PORT),
(int)torrent::get(torrent::HANDSHAKES_TOTAL));
pos = snprintf(buf, 128, "%3i/", (int)torrent::get(torrent::THROTTLE_ROOT_CONST_RATE) / 1024);
if (torrent::get(torrent::THROTTLE_READ_CONST_RATE) == 0)
pos = snprintf(buf + pos, 128 - pos, "off");
else
pos = snprintf(buf + pos, 128 - pos, "%-3i", (int)torrent::get(torrent::THROTTLE_READ_CONST_RATE) / 1024);
m_canvas->print(0, 0, "Throttle U/D: %s Listen: %s:%i Handshakes: %i",
buf,
m_core->get_dns().empty() ? "<default>" : m_core->get_dns().c_str(),
(int)torrent::get(torrent::LISTEN_PORT),
(int)torrent::get(torrent::HANDSHAKES_TOTAL));
}
}