mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 22:52:31 +00:00
Added dual listening ports when both IPv4 and IPv6 are bound.
This commit is contained in:
+42
-41
@@ -7,11 +7,11 @@
|
|||||||
#include <rak/path.h>
|
#include <rak/path.h>
|
||||||
#include <torrent/torrent.h>
|
#include <torrent/torrent.h>
|
||||||
#include <torrent/rate.h>
|
#include <torrent/rate.h>
|
||||||
#include <torrent/connection_manager.h>
|
|
||||||
#include <torrent/data/file_manager.h>
|
#include <torrent/data/file_manager.h>
|
||||||
#include <torrent/download/resource_manager.h>
|
#include <torrent/download/resource_manager.h>
|
||||||
#include <torrent/net/http_stack.h>
|
#include <torrent/net/http_stack.h>
|
||||||
#include <torrent/net/network_config.h>
|
#include <torrent/net/network_config.h>
|
||||||
|
#include <torrent/net/network_manager.h>
|
||||||
#include <torrent/net/socket_address.h>
|
#include <torrent/net/socket_address.h>
|
||||||
#include <torrent/tracker/tracker.h>
|
#include <torrent/tracker/tracker.h>
|
||||||
#include <torrent/utils/log.h>
|
#include <torrent/utils/log.h>
|
||||||
@@ -168,7 +168,8 @@ initialize_command_network() {
|
|||||||
auto cm = torrent::connection_manager();
|
auto cm = torrent::connection_manager();
|
||||||
auto file_manager = torrent::file_manager();
|
auto file_manager = torrent::file_manager();
|
||||||
auto http_stack = torrent::net_thread::http_stack();
|
auto http_stack = torrent::net_thread::http_stack();
|
||||||
auto network_config = torrent::config::network_config();
|
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));
|
CMD2_ANY_STRING ("encoding.add", std::bind(&apply_encoding_list, std::placeholders::_2));
|
||||||
|
|
||||||
@@ -177,18 +178,18 @@ initialize_command_network() {
|
|||||||
CMD2_VAR_BOOL ("network.port_random", true);
|
CMD2_VAR_BOOL ("network.port_random", true);
|
||||||
CMD2_VAR_STRING ("network.port_range", "6881-6999");
|
CMD2_VAR_STRING ("network.port_range", "6881-6999");
|
||||||
|
|
||||||
CMD2_ANY ("network.listen.port", std::bind(&torrent::net::NetworkConfig::listen_port, network_config));
|
CMD2_ANY ("network.listen.port", [nw_manager](auto, auto) { return nw_manager->listen_port(); });
|
||||||
CMD2_ANY ("network.listen.backlog", std::bind(&torrent::net::NetworkConfig::listen_backlog, network_config));
|
CMD2_ANY ("network.listen.backlog", [nw_config](auto, auto) { return nw_config->listen_backlog(); });
|
||||||
CMD2_ANY_VALUE_V ("network.listen.backlog.set", std::bind(&torrent::ConnectionManager::set_listen_backlog, cm, std::placeholders::_2));
|
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_VAR_BOOL ("protocol.pex", true);
|
||||||
CMD2_ANY_LIST ("protocol.encryption.set", std::bind(&apply_encryption, std::placeholders::_2));
|
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.leech", "leech");
|
||||||
CMD2_VAR_STRING ("protocol.connection.seed", "seed");
|
CMD2_VAR_STRING ("protocol.connection.seed", "seed");
|
||||||
|
|
||||||
CMD2_VAR_STRING ("protocol.choke_heuristics.up.leech", "upload_leech");
|
CMD2_VAR_STRING ("protocol.choke_heuristics.up.leech", "upload_leech");
|
||||||
CMD2_VAR_STRING ("protocol.choke_heuristics.up.seed", "upload_leech");
|
CMD2_VAR_STRING ("protocol.choke_heuristics.up.seed", "upload_leech");
|
||||||
CMD2_VAR_STRING ("protocol.choke_heuristics.down.leech", "download_leech");
|
CMD2_VAR_STRING ("protocol.choke_heuristics.down.leech", "download_leech");
|
||||||
CMD2_VAR_STRING ("protocol.choke_heuristics.down.seed", "download_leech");
|
CMD2_VAR_STRING ("protocol.choke_heuristics.down.seed", "download_leech");
|
||||||
|
|
||||||
@@ -212,28 +213,28 @@ initialize_command_network() {
|
|||||||
CMD2_ANY ("network.http.ssl_verify_peer", [http_stack](auto, auto) { return http_stack->ssl_verify_peer(); });
|
CMD2_ANY ("network.http.ssl_verify_peer", [http_stack](auto, auto) { return http_stack->ssl_verify_peer(); });
|
||||||
CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set", [http_stack](auto, auto& value) { return http_stack->set_ssl_verify_peer(value); });
|
CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set", [http_stack](auto, auto& value) { return http_stack->set_ssl_verify_peer(value); });
|
||||||
|
|
||||||
CMD2_ANY ("network.send_buffer.size", [network_config](auto, auto) { return network_config->send_buffer_size(); });
|
CMD2_ANY ("network.send_buffer.size", [nw_config](auto, auto) { return nw_config->send_buffer_size(); });
|
||||||
CMD2_ANY_VALUE_V ("network.send_buffer.size.set", [network_config](auto, auto& value) { return network_config->set_send_buffer_size(value); });
|
CMD2_ANY_VALUE_V ("network.send_buffer.size.set", [nw_config](auto, auto& value) { return nw_config->set_send_buffer_size(value); });
|
||||||
CMD2_ANY ("network.receive_buffer.size", [network_config](auto, auto) { return network_config->receive_buffer_size(); });
|
CMD2_ANY ("network.receive_buffer.size", [nw_config](auto, auto) { return nw_config->receive_buffer_size(); });
|
||||||
CMD2_ANY_VALUE_V ("network.receive_buffer.size.set", [network_config](auto, auto& value) { return network_config->set_receive_buffer_size(value); });
|
CMD2_ANY_VALUE_V ("network.receive_buffer.size.set", [nw_config](auto, auto& value) { return nw_config->set_receive_buffer_size(value); });
|
||||||
CMD2_ANY_STRING ("network.tos.set", [](auto, auto& str) { return apply_tos(str); });
|
CMD2_ANY_STRING ("network.tos.set", [](auto, auto& str) { return apply_tos(str); });
|
||||||
|
|
||||||
CMD2_ANY ("network.bind_address", [network_config](auto, auto) { return network_config->bind_address_best_match_str(); });
|
CMD2_ANY ("network.bind_address", [nw_config](auto, auto) { return nw_config->bind_address_best_match_str(); });
|
||||||
CMD2_ANY_STRING_V("network.bind_address.set", [network_config](auto, auto& str) { return network_config->set_bind_address_str(str); });
|
CMD2_ANY_STRING_V("network.bind_address.set", [nw_config](auto, auto& str) { return nw_config->set_bind_address_str(str); });
|
||||||
CMD2_ANY ("network.bind_address.ipv4", [network_config](auto, auto) { return network_config->bind_inet_address_str(); });
|
CMD2_ANY ("network.bind_address.ipv4", [nw_config](auto, auto) { return nw_config->bind_inet_address_str(); });
|
||||||
CMD2_ANY_STRING_V("network.bind_address.ipv4.set", [network_config](auto, auto& str) { return network_config->set_bind_inet_address_str(str); });
|
CMD2_ANY_STRING_V("network.bind_address.ipv4.set", [nw_config](auto, auto& str) { return nw_config->set_bind_inet_address_str(str); });
|
||||||
CMD2_ANY ("network.bind_address.ipv6", [network_config](auto, auto) { return network_config->bind_inet6_address_str(); });
|
CMD2_ANY ("network.bind_address.ipv6", [nw_config](auto, auto) { return nw_config->bind_inet6_address_str(); });
|
||||||
CMD2_ANY_STRING_V("network.bind_address.ipv6.set", [network_config](auto, auto& str) { return network_config->set_bind_inet6_address_str(str); });
|
CMD2_ANY_STRING_V("network.bind_address.ipv6.set", [nw_config](auto, auto& str) { return nw_config->set_bind_inet6_address_str(str); });
|
||||||
|
|
||||||
CMD2_ANY ("network.local_address", [network_config](auto, auto) { return network_config->local_address_best_match_str(); });
|
CMD2_ANY ("network.local_address", [nw_config](auto, auto) { return nw_config->local_address_best_match_str(); });
|
||||||
CMD2_ANY_STRING_V("network.local_address.set", [network_config](auto, auto& str) { return network_config->set_local_address_str(str); });
|
CMD2_ANY_STRING_V("network.local_address.set", [nw_config](auto, auto& str) { return nw_config->set_local_address_str(str); });
|
||||||
CMD2_ANY ("network.local_address.ipv4", [network_config](auto, auto) { return network_config->local_inet_address_str(); });
|
CMD2_ANY ("network.local_address.ipv4", [nw_config](auto, auto) { return nw_config->local_inet_address_str(); });
|
||||||
CMD2_ANY_STRING_V("network.local_address.ipv4.set", [network_config](auto, auto& str) { return network_config->set_local_inet_address_str(str); });
|
CMD2_ANY_STRING_V("network.local_address.ipv4.set", [nw_config](auto, auto& str) { return nw_config->set_local_inet_address_str(str); });
|
||||||
CMD2_ANY ("network.local_address.ipv6", [network_config](auto, auto) { return network_config->local_inet6_address_str(); });
|
CMD2_ANY ("network.local_address.ipv6", [nw_config](auto, auto) { return nw_config->local_inet6_address_str(); });
|
||||||
CMD2_ANY_STRING_V("network.local_address.ipv6.set", [network_config](auto, auto& str) { return network_config->set_local_inet6_address_str(str); });
|
CMD2_ANY_STRING_V("network.local_address.ipv6.set", [nw_config](auto, auto& str) { return nw_config->set_local_inet6_address_str(str); });
|
||||||
|
|
||||||
CMD2_ANY ("network.proxy_address", [network_config](auto, auto) { return network_config->proxy_address_str(); });
|
CMD2_ANY ("network.proxy_address", [nw_config](auto, auto) { return nw_config->proxy_address_str(); });
|
||||||
CMD2_ANY_STRING_V("network.proxy_address.set", [](auto, auto& str) { return control->core()->set_proxy_address(str); });
|
CMD2_ANY_STRING_V("network.proxy_address.set", [](auto, auto& str) { return control->core()->set_proxy_address(str); });
|
||||||
|
|
||||||
CMD2_ANY ("network.open_files", [file_manager](auto, auto) { return file_manager->open_files(); });
|
CMD2_ANY ("network.open_files", [file_manager](auto, auto) { return file_manager->open_files(); });
|
||||||
CMD2_ANY ("network.max_open_files", [file_manager](auto, auto) { return file_manager->max_open_files(); });
|
CMD2_ANY ("network.max_open_files", [file_manager](auto, auto) { return file_manager->max_open_files(); });
|
||||||
@@ -248,20 +249,20 @@ initialize_command_network() {
|
|||||||
CMD2_VAR_BOOL ("network.scgi.dont_route", false);
|
CMD2_VAR_BOOL ("network.scgi.dont_route", false);
|
||||||
|
|
||||||
CMD2_ANY_STRING ("network.xmlrpc.dialect.set", [](const auto&, const auto& arg) { return apply_xmlrpc_dialect(arg); })
|
CMD2_ANY_STRING ("network.xmlrpc.dialect.set", [](const auto&, const auto& arg) { return apply_xmlrpc_dialect(arg); })
|
||||||
CMD2_ANY ("network.xmlrpc.size_limit", [](const auto&, const auto&){ return rpc::rpc.size_limit(); });
|
CMD2_ANY ("network.xmlrpc.size_limit", [](const auto&, const auto&) { return rpc::rpc.size_limit(); });
|
||||||
CMD2_ANY_VALUE_V ("network.xmlrpc.size_limit.set", [](const auto&, const auto& arg){ return rpc::rpc.set_size_limit(arg); });
|
CMD2_ANY_VALUE_V ("network.xmlrpc.size_limit.set", [](const auto&, const auto& arg) { return rpc::rpc.set_size_limit(arg); });
|
||||||
|
|
||||||
CMD2_VAR_BOOL ("network.rpc.use_xmlrpc", true);
|
CMD2_VAR_BOOL ("network.rpc.use_xmlrpc", true);
|
||||||
CMD2_VAR_BOOL ("network.rpc.use_jsonrpc", true);
|
CMD2_VAR_BOOL ("network.rpc.use_jsonrpc", true);
|
||||||
|
|
||||||
CMD2_ANY ("network.block.ipv4", [network_config](auto, auto) { return network_config->is_block_ipv4(); });
|
CMD2_ANY ("network.block.ipv4", [nw_config](auto, auto) { return nw_config->is_block_ipv4(); });
|
||||||
CMD2_ANY_VALUE_V ("network.block.ipv4.set", [network_config](auto, auto& value) { return network_config->set_block_ipv4(value); });
|
CMD2_ANY_VALUE_V ("network.block.ipv4.set", [nw_config](auto, auto& value) { return nw_config->set_block_ipv4(value); });
|
||||||
CMD2_ANY ("network.block.ipv6", [network_config](auto, auto) { return network_config->is_block_ipv6(); });
|
CMD2_ANY ("network.block.ipv6", [nw_config](auto, auto) { return nw_config->is_block_ipv6(); });
|
||||||
CMD2_ANY_VALUE_V ("network.block.ipv6.set", [network_config](auto, auto& value) { return network_config->set_block_ipv6(value); });
|
CMD2_ANY_VALUE_V ("network.block.ipv6.set", [nw_config](auto, auto& value) { return nw_config->set_block_ipv6(value); });
|
||||||
CMD2_ANY ("network.block.ipv4in6", [network_config](auto, auto) { return network_config->is_block_ipv4in6(); });
|
CMD2_ANY ("network.block.ipv4in6", [nw_config](auto, auto) { return nw_config->is_block_ipv4in6(); });
|
||||||
CMD2_ANY_VALUE_V ("network.block.ipv4in6.set", [network_config](auto, auto& value) { return network_config->set_block_ipv4in6(value); });
|
CMD2_ANY_VALUE_V ("network.block.ipv4in6.set", [nw_config](auto, auto& value) { return nw_config->set_block_ipv4in6(value); });
|
||||||
CMD2_ANY ("network.block.outgoing", [network_config](auto, auto) { return network_config->is_block_outgoing(); });
|
CMD2_ANY ("network.block.outgoing", [nw_config](auto, auto) { return nw_config->is_block_outgoing(); });
|
||||||
CMD2_ANY_VALUE_V ("network.block.outgoing.set", [network_config](auto, auto& value) { return network_config->set_block_outgoing(value); });
|
CMD2_ANY_VALUE_V ("network.block.outgoing.set", [nw_config](auto, auto& value) { return nw_config->set_block_outgoing(value); });
|
||||||
CMD2_ANY ("network.prefer.ipv6", [network_config](auto, auto) { return network_config->is_prefer_ipv6(); });
|
CMD2_ANY ("network.prefer.ipv6", [nw_config](auto, auto) { return nw_config->is_prefer_ipv6(); });
|
||||||
CMD2_ANY_VALUE_V ("network.prefer.ipv6.set", [network_config](auto, auto& value) { return network_config->set_prefer_ipv6(value); });
|
CMD2_ANY_VALUE_V ("network.prefer.ipv6.set", [nw_config](auto, auto& value) { return nw_config->set_prefer_ipv6(value); });
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <torrent/connection_manager.h>
|
|
||||||
#include <torrent/net/http_stack.h>
|
#include <torrent/net/http_stack.h>
|
||||||
|
#include <torrent/net/network_manager.h>
|
||||||
#include <torrent/utils/directory_events.h>
|
#include <torrent/utils/directory_events.h>
|
||||||
|
|
||||||
#include "core/dht_manager.h"
|
#include "core/dht_manager.h"
|
||||||
@@ -38,9 +38,9 @@ Control::Control()
|
|||||||
m_lua_engine(new rpc::LuaEngine()),
|
m_lua_engine(new rpc::LuaEngine()),
|
||||||
m_directory_events(new torrent::directory_events()) {
|
m_directory_events(new torrent::directory_events()) {
|
||||||
|
|
||||||
m_core = std::make_unique<core::Manager>();
|
m_core = std::make_unique<core::Manager>();
|
||||||
m_viewManager = std::make_unique<core::ViewManager>();
|
m_view_manager = std::make_unique<core::ViewManager>();
|
||||||
m_dhtManager = std::make_unique<core::DhtManager>();
|
m_dht_manager = std::make_unique<core::DhtManager>();
|
||||||
|
|
||||||
m_inputStdin->slot_pressed(std::bind(&input::Manager::pressed, m_input.get(), std::placeholders::_1));
|
m_inputStdin->slot_pressed(std::bind(&input::Manager::pressed, m_input.get(), std::placeholders::_1));
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ Control::Control()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Control::~Control() {
|
Control::~Control() {
|
||||||
m_viewManager.reset();
|
m_view_manager.reset();
|
||||||
|
|
||||||
m_ui.reset();
|
m_ui.reset();
|
||||||
m_display.reset();
|
m_display.reset();
|
||||||
@@ -67,7 +67,7 @@ Control::initialize() {
|
|||||||
|
|
||||||
m_core->listen_open();
|
m_core->listen_open();
|
||||||
m_core->download_store()->enable(rpc::call_command_value("session.use_lock"));
|
m_core->download_store()->enable(rpc::call_command_value("session.use_lock"));
|
||||||
m_core->set_hashing_view(*m_viewManager->find_throw("hashing"));
|
m_core->set_hashing_view(*m_view_manager->find_throw("hashing"));
|
||||||
|
|
||||||
m_ui->init(this);
|
m_ui->init(this);
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ Control::handle_shutdown() {
|
|||||||
if (worker_thread->is_active())
|
if (worker_thread->is_active())
|
||||||
worker_thread->stop_thread_wait();
|
worker_thread->stop_thread_wait();
|
||||||
|
|
||||||
torrent::connection_manager()->listen_close();
|
torrent::runtime::network_manager()->listen_close();
|
||||||
|
|
||||||
m_directory_events->close();
|
m_directory_events->close();
|
||||||
m_core->shutdown(false);
|
m_core->shutdown(false);
|
||||||
|
|||||||
+4
-4
@@ -57,8 +57,8 @@ public:
|
|||||||
void receive_quick_shutdown() { m_shutdownReceived = true; m_shutdownQuick = true; }
|
void receive_quick_shutdown() { m_shutdownReceived = true; m_shutdownQuick = true; }
|
||||||
|
|
||||||
core::Manager* core() { return m_core.get(); }
|
core::Manager* core() { return m_core.get(); }
|
||||||
core::ViewManager* view_manager() { return m_viewManager.get(); }
|
core::ViewManager* view_manager() { return m_view_manager.get(); }
|
||||||
core::DhtManager* dht_manager() { return m_dhtManager.get(); }
|
core::DhtManager* dht_manager() { return m_dht_manager.get(); }
|
||||||
|
|
||||||
ui::Root* ui() { return m_ui.get(); }
|
ui::Root* ui() { return m_ui.get(); }
|
||||||
display::Manager* display() { return m_display.get(); }
|
display::Manager* display() { return m_display.get(); }
|
||||||
@@ -82,8 +82,8 @@ private:
|
|||||||
void operator = (const Control&);
|
void operator = (const Control&);
|
||||||
|
|
||||||
std::unique_ptr<core::Manager> m_core;
|
std::unique_ptr<core::Manager> m_core;
|
||||||
std::unique_ptr<core::ViewManager> m_viewManager;
|
std::unique_ptr<core::ViewManager> m_view_manager;
|
||||||
std::unique_ptr<core::DhtManager> m_dhtManager;
|
std::unique_ptr<core::DhtManager> m_dht_manager;
|
||||||
|
|
||||||
std::unique_ptr<ui::Root> m_ui;
|
std::unique_ptr<ui::Root> m_ui;
|
||||||
std::unique_ptr<display::Manager> m_display;
|
std::unique_ptr<display::Manager> m_display;
|
||||||
|
|||||||
+4
-3
@@ -19,6 +19,7 @@
|
|||||||
#include <torrent/throttle.h>
|
#include <torrent/throttle.h>
|
||||||
#include <torrent/net/http_stack.h>
|
#include <torrent/net/http_stack.h>
|
||||||
#include <torrent/net/network_config.h>
|
#include <torrent/net/network_config.h>
|
||||||
|
#include <torrent/net/network_manager.h>
|
||||||
#include <torrent/net/socket_address.h>
|
#include <torrent/net/socket_address.h>
|
||||||
#include <torrent/utils/log.h>
|
#include <torrent/utils/log.h>
|
||||||
|
|
||||||
@@ -175,12 +176,12 @@ Manager::listen_open() {
|
|||||||
if (rpc::call_command_value("network.port_random")) {
|
if (rpc::call_command_value("network.port_random")) {
|
||||||
int boundary = portFirst + random() % (portLast - portFirst + 1);
|
int boundary = portFirst + random() % (portLast - portFirst + 1);
|
||||||
|
|
||||||
if (torrent::connection_manager()->listen_open(boundary, portLast) ||
|
if (torrent::runtime::network_manager()->listen_open(boundary, portLast) ||
|
||||||
torrent::connection_manager()->listen_open(portFirst, boundary))
|
torrent::runtime::network_manager()->listen_open(portFirst, boundary))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (torrent::connection_manager()->listen_open(portFirst, portLast))
|
if (torrent::runtime::network_manager()->listen_open(portFirst, portLast))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-4
@@ -17,6 +17,7 @@
|
|||||||
#include <torrent/download/resource_manager.h>
|
#include <torrent/download/resource_manager.h>
|
||||||
#include <torrent/net/http_stack.h>
|
#include <torrent/net/http_stack.h>
|
||||||
#include <torrent/net/network_config.h>
|
#include <torrent/net/network_config.h>
|
||||||
|
#include <torrent/net/network_manager.h>
|
||||||
#include <torrent/net/socket_address.h>
|
#include <torrent/net/socket_address.h>
|
||||||
#include <torrent/peer/client_info.h>
|
#include <torrent/peer/client_info.h>
|
||||||
|
|
||||||
@@ -375,7 +376,7 @@ print_status_info(char* first, char* last) {
|
|||||||
|
|
||||||
first = print_buffer(first, last, " KB]");
|
first = print_buffer(first, last, " KB]");
|
||||||
|
|
||||||
first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::config::network_config()->listen_port());
|
first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::runtime::network_manager()->listen_port());
|
||||||
|
|
||||||
auto local_address = torrent::config::network_config()->local_address_best_match();
|
auto local_address = torrent::config::network_config()->local_address_best_match();
|
||||||
|
|
||||||
@@ -388,11 +389,24 @@ print_status_info(char* first, char* last) {
|
|||||||
if (first > last)
|
if (first > last)
|
||||||
throw torrent::internal_error("print_status_info(...) wrote past end of the buffer.");
|
throw torrent::internal_error("print_status_info(...) wrote past end of the buffer.");
|
||||||
|
|
||||||
auto bind_address = torrent::config::network_config()->bind_address_best_match();
|
auto bind_inet_address = torrent::config::network_config()->bind_inet_address();
|
||||||
|
auto bind_inet6_address = torrent::config::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());
|
||||||
|
|
||||||
if (!torrent::sa_is_any(bind_address.get())) {
|
if (show_bind_inet || show_bind_inet6) {
|
||||||
first = print_buffer(first, last, " [Bind ");
|
first = print_buffer(first, last, " [Bind ");
|
||||||
first = print_address(first, last, bind_address.get());
|
|
||||||
|
if (show_bind_inet)
|
||||||
|
first = print_address(first, last, bind_inet_address.get());
|
||||||
|
|
||||||
|
if (show_bind_inet6) {
|
||||||
|
if (show_bind_inet)
|
||||||
|
first = print_buffer(first, last, " / ");
|
||||||
|
|
||||||
|
first = print_address(first, last, bind_inet6_address.get());
|
||||||
|
}
|
||||||
|
|
||||||
first = print_buffer(first, last, "]");
|
first = print_buffer(first, last, "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define __STDC_FORMAT_MACROS
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|||||||
Reference in New Issue
Block a user