* Renamed read/write stuff to down/up.

* Adding incomplete PeerConnectionSeed.

* For every new peer connection it would traverse the local bitfield
to check if it was zero'ed, instead of using a cached value. Forgot to
change over when changing it from the BitFieldExt to the normal class.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@547 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-08-29 18:39:34 +00:00
parent a28ed1c96b
commit 2a1f3e12cc
10 changed files with 50 additions and 50 deletions
+3 -3
View File
@@ -71,9 +71,9 @@ print_download_info(char* buf, unsigned int length, core::Download* d) {
(double)d->get_download().get_bytes_total() / (double)(1 << 20)));
buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KB Uploaded: %.1f MB",
(double)d->get_download().get_write_rate().rate() / (1 << 10),
(double)d->get_download().get_read_rate().rate() / (1 << 10),
(double)d->get_download().get_write_rate().total() / (1 << 20)));
(double)d->get_download().get_up_rate().rate() / (1 << 10),
(double)d->get_download().get_down_rate().rate() / (1 << 10),
(double)d->get_download().get_up_rate().total() / (1 << 20)));
return buf;
}
+4 -4
View File
@@ -91,10 +91,10 @@ WindowPeerInfo::redraw() {
m_canvas->print(0, y++, "Done: %i%", done_percentage(**m_focus));
m_canvas->print(0, y++, "Rate: %5.1f/%5.1f KB Total: %.1f/%.1f MB",
(double)(*m_focus)->get_write_rate().rate() / (double)(1 << 10),
(double)(*m_focus)->get_read_rate().rate() / (double)(1 << 10),
(double)(*m_focus)->get_write_rate().total() / (double)(1 << 20),
(double)(*m_focus)->get_read_rate().total() / (double)(1 << 20));
(double)(*m_focus)->get_up_rate().rate() / (double)(1 << 10),
(double)(*m_focus)->get_down_rate().rate() / (double)(1 << 10),
(double)(*m_focus)->get_up_rate().total() / (double)(1 << 20),
(double)(*m_focus)->get_down_rate().total() / (double)(1 << 20));
}
int
+2 -2
View File
@@ -97,8 +97,8 @@ WindowPeerList::redraw() {
p.get_dns().c_str());
x += 18;
m_canvas->print(x, y, "%.1f", (double)p.get_write_rate().rate() / 1024); x += 7;
m_canvas->print(x, y, "%.1f", (double)p.get_read_rate().rate() / 1024); x += 7;
m_canvas->print(x, y, "%.1f", (double)p.get_up_rate().rate() / 1024); x += 7;
m_canvas->print(x, y, "%.1f", (double)p.get_down_rate().rate() / 1024); x += 7;
m_canvas->print(x, y, "%.1f", (double)p.get_peer_rate().rate() / 1024); x += 7;
m_canvas->print(x, y, "%c/%c%c/%c%c",
+6 -6
View File
@@ -62,20 +62,20 @@ WindowStatusbar::redraw() {
int pos = 0;
char buf[128];
if (torrent::get_write_throttle() == 0)
if (torrent::get_up_throttle() == 0)
pos = snprintf(buf, 128, "off/");
else
pos = snprintf(buf, 128, "%3i/", torrent::get_write_throttle() / 1024);
pos = snprintf(buf, 128, "%3i/", torrent::get_up_throttle() / 1024);
if (torrent::get_read_throttle() == 0)
if (torrent::get_down_throttle() == 0)
pos = snprintf(buf + pos, 128 - pos, "off");
else
pos = snprintf(buf + pos, 128 - pos, "%-3i", torrent::get_read_throttle() / 1024);
pos = snprintf(buf + pos, 128 - pos, "%-3i", torrent::get_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::get_write_rate().rate() / 1024.0,
(double)torrent::get_read_rate().rate() / 1024.0,
(double)torrent::get_up_rate().rate() / 1024.0,
(double)torrent::get_down_rate().rate() / 1024.0,
!torrent::get_local_address().empty() ? torrent::get_local_address().c_str() : "<default>",
(int)torrent::get_listen_port(),
!torrent::get_bind_address().empty() ? (" Bind: " + torrent::get_bind_address()).c_str() : "");