diff --git a/src/command_network.cc b/src/command_network.cc index e333b7e4..b4b3dcd0 100644 --- a/src/command_network.cc +++ b/src/command_network.cc @@ -8,8 +8,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -31,18 +31,18 @@ torrent::Object apply_encryption(const torrent::Object::list_type& args) { - uint32_t options_mask = torrent::net::NetworkConfig::encryption_none; + uint32_t options_mask = torrent::runtime::NetworkConfig::encryption_none; for (const auto& arg : args) { uint32_t opt = torrent::option_find_string(torrent::OPTION_ENCRYPTION, arg.as_string().c_str()); - if (opt == torrent::net::NetworkConfig::encryption_none) - options_mask = torrent::net::NetworkConfig::encryption_none; + if (opt == torrent::runtime::NetworkConfig::encryption_none) + options_mask = torrent::runtime::NetworkConfig::encryption_none; else options_mask |= opt; } - torrent::config::network_config()->set_encryption_options(options_mask); + torrent::runtime::network_config()->set_encryption_options(options_mask); return torrent::Object(); } @@ -54,7 +54,7 @@ apply_tos(const torrent::Object::string_type& arg) { if (!rpc::parse_whole_value_nothrow(arg.c_str(), &value, 16, 1)) value = torrent::option_find_string(torrent::OPTION_IP_TOS, arg.c_str()); - torrent::config::network_config()->set_priority(value); + torrent::runtime::network_config()->set_priority(value); return torrent::Object(); } @@ -215,10 +215,10 @@ apply_xmlrpc_dialect(const std::string& arg) { void initialize_command_network() { - auto cm = torrent::connection_manager(); + auto cm = torrent::connection_manager(); auto file_manager = torrent::file_manager(); - auto http_stack = torrent::net_thread::http_stack(); - auto nw_config = torrent::config::network_config(); + auto http_stack = torrent::net_thread::http_stack(); + auto nw_config = torrent::runtime::network_config(); CMD2_ANY_STRING ("encoding.add", std::bind(&apply_encoding_list, std::placeholders::_2)); diff --git a/src/command_tracker.cc b/src/command_tracker.cc index 1d1097b3..194d8fa7 100644 --- a/src/command_tracker.cc +++ b/src/command_tracker.cc @@ -3,8 +3,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -146,8 +146,8 @@ initialize_command_tracker() { CMD2_ANY_VALUE_V ("dht.port.set", [](auto, auto) { lt_log_print(torrent::LOG_DHT_ERROR, "dht.port.set is no longer supported, use dht.override_port.set", 0); }); - CMD2_ANY ("dht.override_port", std::bind(&torrent::net::NetworkConfig::override_dht_port, torrent::config::network_config())); - CMD2_ANY_VALUE_V ("dht.override_port.set", std::bind(&torrent::net::NetworkConfig::set_override_dht_port, torrent::config::network_config(), std::placeholders::_2)); + CMD2_ANY ("dht.override_port", std::bind(&torrent::runtime::NetworkConfig::override_dht_port, torrent::runtime::network_config())); + CMD2_ANY_VALUE_V ("dht.override_port.set", std::bind(&torrent::runtime::NetworkConfig::set_override_dht_port, torrent::runtime::network_config(), std::placeholders::_2)); CMD2_ANY_STRING ("dht.add_node", std::bind(&apply_dht_add_node, std::placeholders::_2)); CMD2_ANY ("dht.statistics", std::bind(&core::DhtManager::dht_statistics, dht_manager)); diff --git a/src/core/manager.cc b/src/core/manager.cc index 5370310c..24edbb5d 100644 --- a/src/core/manager.cc +++ b/src/core/manager.cc @@ -17,8 +17,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -219,7 +219,7 @@ Manager::set_proxy_address(const std::string& addr) { try { torrent::sa_set_port(sa.get(), port); - torrent::config::network_config()->set_proxy_address(sa.get()); + torrent::runtime::network_config()->set_proxy_address(sa.get()); } catch (torrent::input_error& e) { throw e; diff --git a/src/display/utils.cc b/src/display/utils.cc index 1f8dddc2..d1b40184 100644 --- a/src/display/utils.cc +++ b/src/display/utils.cc @@ -16,9 +16,9 @@ #include #include #include -#include #include #include +#include #include "control.h" #include "globals.h" @@ -376,7 +376,7 @@ print_status_info(char* first, char* last) { first = print_buffer(first, last, " KB]"); first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::runtime::listen_port()); - auto local_address = torrent::config::network_config()->local_address_best_match(); + auto local_address = torrent::runtime::network_config()->local_address_best_match(); if (!torrent::sa_is_any(local_address.get())) { first = print_buffer(first, last, " [Local "); @@ -387,8 +387,8 @@ print_status_info(char* first, char* last) { if (first > last) throw torrent::internal_error("print_status_info(...) wrote past end of the buffer."); - auto bind_inet_address = torrent::config::network_config()->bind_inet_address(); - auto bind_inet6_address = torrent::config::network_config()->bind_inet6_address(); + auto bind_inet_address = torrent::runtime::network_config()->bind_inet_address(); + auto bind_inet6_address = torrent::runtime::network_config()->bind_inet6_address(); bool show_bind_inet = !torrent::sa_is_any(bind_inet_address.get()); bool show_bind_inet6 = !torrent::sa_is_any(bind_inet6_address.get()); diff --git a/test/rpc/test_parse_options.cc b/test/rpc/test_parse_options.cc index 632e32e8..6176a0fa 100644 --- a/test/rpc/test_parse_options.cc +++ b/test/rpc/test_parse_options.cc @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include @@ -178,11 +178,11 @@ TestParseOptions::test_flag_libtorrent() { void TestParseOptions::test_flags_libtorrent() { - FLAGS_LT_ENCRYPTION_ASSERT("", torrent::net::NetworkConfig::encryption_none); - FLAGS_LT_ENCRYPTION_ASSERT("none", torrent::net::NetworkConfig::encryption_none); - FLAGS_LT_ENCRYPTION_ASSERT("require_rc4", torrent::net::NetworkConfig::encryption_require_RC4); - FLAGS_LT_ENCRYPTION_ASSERT("require_RC4", torrent::net::NetworkConfig::encryption_require_RC4); - FLAGS_LT_ENCRYPTION_ASSERT("require_RC4 | enable_retry", torrent::net::NetworkConfig::encryption_require_RC4 | torrent::net::NetworkConfig::encryption_enable_retry); + FLAGS_LT_ENCRYPTION_ASSERT("", torrent::runtime::NetworkConfig::encryption_none); + FLAGS_LT_ENCRYPTION_ASSERT("none", torrent::runtime::NetworkConfig::encryption_none); + FLAGS_LT_ENCRYPTION_ASSERT("require_rc4", torrent::runtime::NetworkConfig::encryption_require_RC4); + FLAGS_LT_ENCRYPTION_ASSERT("require_RC4", torrent::runtime::NetworkConfig::encryption_require_RC4); + FLAGS_LT_ENCRYPTION_ASSERT("require_RC4 | enable_retry", torrent::runtime::NetworkConfig::encryption_require_RC4 | torrent::runtime::NetworkConfig::encryption_enable_retry); FLAGS_LT_ENCRYPTION_ASSERT_ERROR("require_"); }