mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-17 07:32:32 +00:00
* Added global download slots. The "max_downloads_hack" option may be
used to test this feature. Note that there seems to be a bug in the code causing exceptions. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@866 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -287,6 +287,10 @@ print_status_extra(char* first, char* last) {
|
||||
torrent::currently_unchoked(),
|
||||
torrent::max_unchoked());
|
||||
|
||||
first = print_buffer(first, last, " [D %i/%i]",
|
||||
torrent::download_unchoked(),
|
||||
torrent::max_download_unchoked());
|
||||
|
||||
first = print_buffer(first, last, " [H %u/%u]",
|
||||
control->core()->get_poll_manager()->get_http_stack()->active(),
|
||||
control->core()->get_poll_manager()->get_http_stack()->max_active());
|
||||
|
||||
@@ -110,7 +110,7 @@ WindowPeerList::redraw() {
|
||||
|
||||
m_canvas->print(x, y, "%c/%c%c/%c%c",
|
||||
p.is_encrypted() ? (p.is_incoming() ? 'R' : 'L') : (p.is_incoming() ? 'r' : 'l'),
|
||||
p.is_remote_choked() ? 'c' : 'u',
|
||||
p.is_remote_queued() ? (p.is_remote_choked() ? 'C' : 'u') : (p.is_remote_choked() ? 'c' : 'U'),
|
||||
p.is_remote_interested() ? 'i' : 'n',
|
||||
p.is_local_choked() ? 'c' : 'u',
|
||||
p.is_local_interested() ? 'i' : 'n');
|
||||
|
||||
@@ -57,38 +57,6 @@ WindowStatusbar::redraw() {
|
||||
char* position;
|
||||
char* last = buffer + m_canvas->width();
|
||||
|
||||
// if (torrent::up_throttle() == 0)
|
||||
// position = std::max(snprintf(buffer, 128, "off/"), 0);
|
||||
// else
|
||||
// position = std::max(snprintf(buffer, 128, "%3i/", torrent::up_throttle() / 1024), 0);
|
||||
|
||||
// if (torrent::down_throttle() == 0)
|
||||
// pos = snprintf(buf + pos, 128 - pos, "off");
|
||||
// else
|
||||
// pos = snprintf(buf + pos, 128 - pos, "%-3i", torrent::down_throttle() / 1024);
|
||||
|
||||
// m_canvas->print(0, 0, "Throttle U/D: %s Rate: %5.1f / %5.1f KB Listen: %s:%i%s",
|
||||
// buf,
|
||||
// (double)torrent::up_rate()->rate() / 1024.0,
|
||||
// (double)torrent::down_rate()->rate() / 1024.0,
|
||||
// !torrent::local_address().empty() ? torrent::local_address().c_str() : "<default>",
|
||||
// (int)torrent::listen_port(),
|
||||
// !torrent::bind_address().empty() ? (" Bind: " + torrent::bind_address()).c_str() : "");
|
||||
|
||||
// #ifndef USE_EXTRA_DEBUG
|
||||
// pos = snprintf(buf, 128, "[U %i/%i][S %i/%i/%i][F %i/%i]",
|
||||
// #else
|
||||
// pos = snprintf(buf, 128, "%i [U %i/%i][S %i/%i/%i][F %i/%i]",
|
||||
// (int)(m_control->tick() - m_lastTick),
|
||||
// #endif
|
||||
// torrent::currently_unchoked(),
|
||||
// torrent::max_unchoked(),
|
||||
// torrent::total_handshakes(),
|
||||
// torrent::open_sockets(),
|
||||
// torrent::max_open_sockets(),
|
||||
// torrent::open_files(),
|
||||
// torrent::max_open_files());
|
||||
|
||||
position = print_status_info(buffer, last);
|
||||
m_canvas->print(0, 0, "%s", buffer);
|
||||
|
||||
|
||||
@@ -489,6 +489,8 @@ initialize_variables() {
|
||||
variables->insert("max_uploads_div", new utils::VariableValue(1));
|
||||
variables->insert("max_chunks_queued", new utils::VariableValue(0));
|
||||
|
||||
variables->insert("max_downloads_hack", new utils::VariableValueSlot(rak::ptr_fn(&torrent::max_download_unchoked), rak::ptr_fn(&torrent::set_max_download_unchoked)));
|
||||
|
||||
variables->insert("download_rate", new utils::VariableValueSlot(rak::ptr_fn(&torrent::down_throttle), rak::mem_fn(control->ui(), &ui::Root::set_down_throttle_i64),
|
||||
0, (1 << 10)));
|
||||
variables->insert("upload_rate", new utils::VariableValueSlot(rak::ptr_fn(&torrent::up_throttle), rak::mem_fn(control->ui(), &ui::Root::set_up_throttle_i64),
|
||||
|
||||
Reference in New Issue
Block a user