mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 12:12:31 +00:00
* Reverse the color of currently downloading chunks in chunks
seen. Patch by Josef Drexler, public domain. * Moving various stuff from Delegator to TransferList. * Added checks in HandshakeManager::receive_* to check for invalid handshakes. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@716 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <stdexcept>
|
||||
#include <rak/socket_address.h>
|
||||
#include <torrent/block_transfer.h>
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/piece.h>
|
||||
|
||||
@@ -83,9 +84,9 @@ WindowPeerList::redraw() {
|
||||
typedef std::pair<PList::iterator, PList::iterator> Range;
|
||||
|
||||
Range range = rak::advance_bidirectional(m_list->begin(),
|
||||
*m_focus != m_list->end() ? *m_focus : m_list->begin(),
|
||||
m_list->end(),
|
||||
m_canvas->get_height() - y);
|
||||
*m_focus != m_list->end() ? *m_focus : m_list->begin(),
|
||||
m_list->end(),
|
||||
m_canvas->get_height() - y);
|
||||
|
||||
if (m_download->download()->chunks_total() <= 0)
|
||||
throw std::logic_error("WindowPeerList::redraw() m_slotChunksTotal() returned invalid value");
|
||||
@@ -96,8 +97,8 @@ WindowPeerList::redraw() {
|
||||
x = 0;
|
||||
|
||||
m_canvas->print(x, y, "%c %s",
|
||||
range.first == *m_focus ? '*' : ' ',
|
||||
rak::socket_address::cast_from(p.address())->address_str().c_str());
|
||||
range.first == *m_focus ? '*' : ' ',
|
||||
rak::socket_address::cast_from(p.address())->address_str().c_str());
|
||||
x += 18;
|
||||
|
||||
m_canvas->print(x, y, "%.1f", (double)p.up_rate()->rate() / 1024); x += 7;
|
||||
@@ -105,23 +106,23 @@ WindowPeerList::redraw() {
|
||||
m_canvas->print(x, y, "%.1f", (double)p.peer_rate()->rate() / 1024); x += 7;
|
||||
|
||||
m_canvas->print(x, y, "%c/%c%c/%c%c",
|
||||
p.is_incoming() ? 'r' : 'l',
|
||||
p.is_remote_choked() ? 'c' : 'u',
|
||||
p.is_remote_interested() ? 'i' : 'n',
|
||||
p.is_local_choked() ? 'c' : 'u',
|
||||
p.is_local_interested() ? 'i' : 'n');
|
||||
p.is_incoming() ? 'r' : 'l',
|
||||
p.is_remote_choked() ? 'c' : 'u',
|
||||
p.is_remote_interested() ? 'i' : 'n',
|
||||
p.is_local_choked() ? 'c' : 'u',
|
||||
p.is_local_interested() ? 'i' : 'n');
|
||||
x += 9;
|
||||
|
||||
m_canvas->print(x, y, "%i/%i",
|
||||
p.outgoing_queue_size(),
|
||||
p.incoming_queue_size());
|
||||
m_canvas->print(x, y, "%i/%i", p.outgoing_queue_size(), p.incoming_queue_size());
|
||||
x += 6;
|
||||
|
||||
m_canvas->print(x, y, "%3i", done_percentage(*range.first));
|
||||
x += 6;
|
||||
|
||||
if (p.incoming_queue_size())
|
||||
m_canvas->print(x, y, "%i", p.incoming_queue(0)->index());
|
||||
const torrent::BlockTransfer* transfer = p.transfer();
|
||||
|
||||
if (transfer != NULL)
|
||||
m_canvas->print(x, y, "%i", transfer->index());
|
||||
|
||||
x += 6;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user