diff --git a/src/display/window_download_statusbar.cc b/src/display/window_download_statusbar.cc index 58ff9c37..04b8cfee 100644 --- a/src/display/window_download_statusbar.cc +++ b/src/display/window_download_statusbar.cc @@ -79,12 +79,14 @@ WindowDownloadStatusbar::redraw() { // (double)m_download->get_download().get_read_rate().rate() / 1024.0, // (double)m_download->get_download().get_write_rate().total() / (double)(1 << 20)); - m_canvas->print(0, 1, "Peers: %i(%i) Min/Max: %i/%i Uploads: %i", + m_canvas->print(0, 1, "Peers: %i(%i) Min/Max: %i/%i Uploads: %i U/I: %i/%i", (int)m_download->get_download().get_peers_connected(), (int)m_download->get_download().get_peers_not_connected(), (int)m_download->get_download().get_peers_min(), (int)m_download->get_download().get_peers_max(), - (int)m_download->get_download().get_uploads_max()); + (int)m_download->get_download().get_uploads_max(), + (int)m_download->get_download().peers_currently_unchoked(), + (int)m_download->get_download().peers_currently_interested()); position = print_download_status(buffer, last - buffer, m_download); m_canvas->print(0, 2, "[%c:%i] %s", diff --git a/src/display/window_statusbar.cc b/src/display/window_statusbar.cc index c7b37508..cd98816d 100644 --- a/src/display/window_statusbar.cc +++ b/src/display/window_statusbar.cc @@ -80,7 +80,9 @@ WindowStatusbar::redraw() { (int)torrent::get_listen_port(), !torrent::get_bind_address().empty() ? (" Bind: " + torrent::get_bind_address()).c_str() : ""); - pos = snprintf(buf, 128, "[S %i/%i/%i] [F %i/%i]", + pos = snprintf(buf, 128, "[U %i/%i][S %i/%i/%i][F %i/%i]", + torrent::currently_unchoked(), + torrent::max_unchoked(), torrent::get_total_handshakes(), torrent::get_open_sockets(), torrent::get_max_open_sockets(), diff --git a/src/ui/root.cc b/src/ui/root.cc index 71ada55a..ff49902a 100644 --- a/src/ui/root.cc +++ b/src/ui/root.cc @@ -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(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)); } }