From 9489793dcbeb3c9236523e232dbe119a02b2590c Mon Sep 17 00:00:00 2001 From: Jari Sundell Date: Tue, 27 Jan 2026 00:21:05 +0100 Subject: [PATCH] Created torrent/runtime include directory. --- src/command_network.cc | 6 ++---- src/command_tracker.cc | 2 +- src/control.cc | 2 +- src/core/dht_manager.cc | 2 +- src/core/manager.cc | 2 +- src/display/utils.cc | 4 +--- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/command_network.cc b/src/command_network.cc index 6e2a6460..e21523b8 100644 --- a/src/command_network.cc +++ b/src/command_network.cc @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -167,7 +166,6 @@ initialize_command_network() { auto file_manager = torrent::file_manager(); auto http_stack = torrent::net_thread::http_stack(); auto nw_config = torrent::config::network_config(); - auto nw_manager = torrent::runtime::network_manager(); CMD2_ANY_STRING ("encoding.add", std::bind(&apply_encoding_list, std::placeholders::_2)); @@ -176,12 +174,12 @@ initialize_command_network() { CMD2_VAR_BOOL ("network.port_random", true); CMD2_VAR_STRING ("network.port_range", "6881-6999"); - CMD2_ANY ("network.listen.port", [nw_manager](auto, auto) { return nw_manager->listen_port(); }); + CMD2_ANY ("network.listen.port", [](auto, auto) { return torrent::runtime::listen_port(); }); CMD2_ANY ("network.listen.backlog", [nw_config](auto, auto) { return nw_config->listen_backlog(); }); CMD2_ANY_VALUE_V ("network.listen.backlog.set", [nw_config](auto, auto& value) { return nw_config->set_listen_backlog(value); }); CMD2_VAR_BOOL ("protocol.pex", true); - CMD2_ANY_LIST ("protocol.encryption.set", [](auto, auto& args) { return apply_encryption(args); }); + CMD2_ANY_LIST ("protocol.encryption.set", [](auto, auto& args) { return apply_encryption(args); }); CMD2_VAR_STRING ("protocol.connection.leech", "leech"); CMD2_VAR_STRING ("protocol.connection.seed", "seed"); diff --git a/src/command_tracker.cc b/src/command_tracker.cc index 86a870ec..5bcdd960 100644 --- a/src/command_tracker.cc +++ b/src/command_tracker.cc @@ -4,8 +4,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/src/control.cc b/src/control.cc index 87f2e97b..28e07c90 100644 --- a/src/control.cc +++ b/src/control.cc @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "core/dht_manager.h" diff --git a/src/core/dht_manager.cc b/src/core/dht_manager.cc index 3a094936..57d64ae4 100644 --- a/src/core/dht_manager.cc +++ b/src/core/dht_manager.cc @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/core/manager.cc b/src/core/manager.cc index c9979432..98911d6b 100644 --- a/src/core/manager.cc +++ b/src/core/manager.cc @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #include #include "rpc/parse_commands.h" diff --git a/src/display/utils.cc b/src/display/utils.cc index baef1e5b..c67f2d58 100644 --- a/src/display/utils.cc +++ b/src/display/utils.cc @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -375,8 +374,7 @@ print_status_info(char* first, char* last) { first = print_status_throttle_rate(first, last, false, throttle_down_names, global_downrate); first = print_buffer(first, last, " KB]"); - - first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::runtime::network_manager()->listen_port()); + first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::runtime::listen_port()); auto local_address = torrent::config::network_config()->local_address_best_match();