mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 05:32:31 +00:00
* Added more logging facilities.
* Ignore logging of alloc/dealloc for chunks during initial hashing. * Moved torrent::ResourceManager to 'src/torrent/peer/' and removed old functions from 'torrent.h'. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1212 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/data/file_manager.h>
|
||||
#include <torrent/peer/peer_list.h>
|
||||
#include <torrent/peer/resource_manager.h>
|
||||
#include <torrent/utils/option_strings.h>
|
||||
|
||||
#include "core/dht_manager.h"
|
||||
@@ -636,8 +637,8 @@ initialize_command_network() {
|
||||
CMD2_VAR_STRING ("protocol.choke_heuristics.down.leech", "download_leech");
|
||||
CMD2_VAR_STRING ("protocol.choke_heuristics.down.seed", "download_leech");
|
||||
|
||||
CMD2_ANY ("throttle.unchoked_uploads", std::bind(&torrent::currently_unchoked));
|
||||
CMD2_ANY ("throttle.unchoked_downloads", std::bind(&torrent::download_unchoked));
|
||||
CMD2_ANY ("throttle.unchoked_uploads", std::bind(&torrent::ResourceManager::currently_upload_unchoked, torrent::resource_manager()));
|
||||
CMD2_ANY ("throttle.unchoked_downloads", std::bind(&torrent::ResourceManager::currently_download_unchoked, torrent::resource_manager()));
|
||||
|
||||
CMD2_VAR_VALUE ("throttle.min_peers.normal", 40);
|
||||
CMD2_VAR_VALUE ("throttle.max_peers.normal", 100);
|
||||
@@ -700,6 +701,7 @@ initialize_command_network() {
|
||||
|
||||
CMD2_ANY ("network.max_open_files", std::bind(&torrent::FileManager::max_open_files, fileManager));
|
||||
CMD2_ANY_VALUE_V ("network.max_open_files.set", std::bind(&torrent::FileManager::set_max_open_files, fileManager, std::placeholders::_2));
|
||||
CMD2_ANY ("network.open_sockets", std::bind(&torrent::ConnectionManager::size, cm));
|
||||
CMD2_ANY ("network.max_open_sockets", std::bind(&torrent::ConnectionManager::max_size, cm));
|
||||
CMD2_ANY_VALUE_V ("network.max_open_sockets.set", std::bind(&torrent::ConnectionManager::set_max_size, cm, std::placeholders::_2));
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <torrent/data/file_list.h>
|
||||
#include <torrent/data/file_manager.h>
|
||||
#include <torrent/peer/client_info.h>
|
||||
#include <torrent/peer/resource_manager.h>
|
||||
|
||||
#include "core/download.h"
|
||||
#include "core/manager.h"
|
||||
@@ -293,12 +294,12 @@ print_status_info(char* first, char* last) {
|
||||
char*
|
||||
print_status_extra(char* first, char* last) {
|
||||
first = print_buffer(first, last, " [U %i/%i]",
|
||||
torrent::currently_unchoked(),
|
||||
torrent::max_unchoked());
|
||||
torrent::resource_manager()->currently_upload_unchoked(),
|
||||
torrent::resource_manager()->max_upload_unchoked());
|
||||
|
||||
first = print_buffer(first, last, " [D %i/%i]",
|
||||
torrent::download_unchoked(),
|
||||
torrent::max_download_unchoked());
|
||||
torrent::resource_manager()->currently_download_unchoked(),
|
||||
torrent::resource_manager()->max_download_unchoked());
|
||||
|
||||
first = print_buffer(first, last, " [H %u/%u]",
|
||||
control->core()->http_stack()->active(),
|
||||
|
||||
+7
-6
@@ -41,6 +41,7 @@
|
||||
#include <sigc++/adaptors/bind.h>
|
||||
#include <torrent/throttle.h>
|
||||
#include <torrent/torrent.h>
|
||||
#include <torrent/peer/resource_manager.h>
|
||||
|
||||
#include "core/manager.h"
|
||||
#include "display/frame.h"
|
||||
@@ -170,7 +171,7 @@ Root::set_down_throttle(unsigned int throttle) {
|
||||
unsigned int global = std::max<int>(rpc::call_command_value("throttle.max_downloads.global"), 0);
|
||||
|
||||
if (throttle == 0 || div == 0) {
|
||||
torrent::set_max_download_unchoked(global);
|
||||
torrent::resource_manager()->set_max_download_unchoked(global);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -184,9 +185,9 @@ Root::set_down_throttle(unsigned int throttle) {
|
||||
maxUnchoked = 10 + throttle / 5;
|
||||
|
||||
if (global != 0)
|
||||
torrent::set_max_download_unchoked(std::min(maxUnchoked, global));
|
||||
torrent::resource_manager()->set_max_download_unchoked(std::min(maxUnchoked, global));
|
||||
else
|
||||
torrent::set_max_download_unchoked(maxUnchoked);
|
||||
torrent::resource_manager()->set_max_download_unchoked(maxUnchoked);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -200,7 +201,7 @@ Root::set_up_throttle(unsigned int throttle) {
|
||||
unsigned int global = std::max<int>(rpc::call_command_value("throttle.max_uploads.global"), 0);
|
||||
|
||||
if (throttle == 0 || div == 0) {
|
||||
torrent::set_max_unchoked(global);
|
||||
torrent::resource_manager()->set_max_upload_unchoked(global);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,9 +215,9 @@ Root::set_up_throttle(unsigned int throttle) {
|
||||
maxUnchoked = 10 + throttle / 5;
|
||||
|
||||
if (global != 0)
|
||||
torrent::set_max_unchoked(std::min(maxUnchoked, global));
|
||||
torrent::resource_manager()->set_max_upload_unchoked(std::min(maxUnchoked, global));
|
||||
else
|
||||
torrent::set_max_unchoked(maxUnchoked);
|
||||
torrent::resource_manager()->set_max_upload_unchoked(maxUnchoked);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user