From 9cb48a9f66aba4e94ad2cd90e6572150c17ad6b9 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Thu, 4 Oct 2007 14:54:31 +0000 Subject: [PATCH] * Disable PEX when we are connected to enough peers. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@983 e378c898-3ddf-0310-93e7-cc216c733640 --- src/command_download.cc | 1 + src/ui/download.cc | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command_download.cc b/src/command_download.cc index 956639d5..8de05db0 100644 --- a/src/command_download.cc +++ b/src/command_download.cc @@ -392,6 +392,7 @@ initialize_command_download() { ADD_CD_VALUE("is_hash_checking", rak::on(std::mem_fun(&core::Download::download), std::mem_fun(&torrent::Download::is_hash_checking))); ADD_CD_VALUE("is_multi_file", rak::on(std::mem_fun(&core::Download::file_list), std::mem_fun(&torrent::FileList::is_multi_file))); ADD_CD_VALUE("is_private", rak::on(std::mem_fun(&core::Download::download), std::mem_fun(&torrent::Download::is_private))); + ADD_CD_VALUE("is_pex_active", rak::on(std::mem_fun(&core::Download::download), std::mem_fun(&torrent::Download::is_pex_active))); ADD_CD_VARIABLE_STRING_PUBLIC("custom1", "rtorrent", "custom1"); ADD_CD_VARIABLE_STRING_PUBLIC("custom2", "rtorrent", "custom2"); diff --git a/src/ui/download.cc b/src/ui/download.cc index 33aab7ce..cf32c748 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -160,7 +160,10 @@ Download::create_info() { element->push_back(""); element->push_column("Chunks:", te_command("cat=$d.get_completed_chunks=,\" / \",$d.get_size_chunks=,\" * \",$d.get_chunk_size=")); element->push_column("Priority:", te_command("d.get_priority=")); - element->push_column("Peer exchange:", te_command("cat=$if=$d.get_peer_exchange=\\,enabled\\,disabled,\\ (,$d.get_size_pex=,/,$d.get_max_size_pex=,)")); +// element->push_column("Peer exchange:", te_command("cat=$if=$d.get_peer_exchange=\\,enabled\\,disabled,\\ (,$d.get_size_pex=,/,$d.get_max_size_pex=,)")); + element->push_column("Peer exchange:", te_command("cat=$if=$d.get_peer_exchange=\\,enabled\\,disabled,\\ ," + "$if=$d.is_pex_active=\\,active\\,inactive," + "\\ (,$d.get_size_pex=,/,$d.get_max_size_pex=,)")); element->push_column("State changed:", te_command("to_elapsed_time=$d.get_state_changed="));