From 3798de01a0104d17d3349cb0ed5608b2e072e32b Mon Sep 17 00:00:00 2001 From: Trog Date: Sun, 1 Dec 2019 05:55:23 +0000 Subject: [PATCH] few missing sub-commands of network and throttle for the RPC interface (#937) --- src/command_network.cc | 2 ++ src/command_throttle.cc | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/command_network.cc b/src/command_network.cc index 092287a5..8de59f0c 100644 --- a/src/command_network.cc +++ b/src/command_network.cc @@ -286,8 +286,10 @@ initialize_command_network() { CMD2_ANY ("network.proxy_address", std::bind(&core::Manager::proxy_address, control->core())); CMD2_ANY_STRING_V("network.proxy_address.set", std::bind(&core::Manager::set_proxy_address, control->core(), std::placeholders::_2)); + CMD2_ANY ("network.open_files", std::bind(&torrent::FileManager::open_files, fileManager)); 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.total_handshakes", std::bind(&torrent::total_handshakes)); 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)); diff --git a/src/command_throttle.cc b/src/command_throttle.cc index fde828a5..8902e62b 100644 --- a/src/command_throttle.cc +++ b/src/command_throttle.cc @@ -176,8 +176,10 @@ throttle_update(const char* variable, int64_t value) { void initialize_command_throttle() { - 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_ANY ("throttle.unchoked_uploads", std::bind(&torrent::ResourceManager::currently_upload_unchoked, torrent::resource_manager())); + CMD2_ANY ("throttle.max_unchoked_uploads", std::bind(&torrent::ResourceManager::max_upload_unchoked, torrent::resource_manager())); + CMD2_ANY ("throttle.unchoked_downloads", std::bind(&torrent::ResourceManager::currently_download_unchoked, torrent::resource_manager())); + CMD2_ANY ("throttle.max_unchoked_downloads", std::bind(&torrent::ResourceManager::max_download_unchoked, torrent::resource_manager())); CMD2_VAR_VALUE ("throttle.min_peers.normal", 100); CMD2_VAR_VALUE ("throttle.max_peers.normal", 200);