mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-05 17:52:29 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8550facf43 | |||
| 184ead294a | |||
| 84bfc491ba | |||
| a2e0eca6e3 | |||
| 92eecdfd52 | |||
| 14219666c5 | |||
| a79a844dac | |||
| 59b6a013ce |
+3
-3
@@ -1,6 +1,6 @@
|
||||
m4_pattern_allow([PKG_CHECK_EXISTS])
|
||||
|
||||
AC_INIT([rtorrent],[0.16.1],[sundell.software@gmail.com])
|
||||
AC_INIT([rtorrent],[0.16.2],[sundell.software@gmail.com])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIRS([scripts])
|
||||
@@ -11,7 +11,7 @@ LT_INIT
|
||||
|
||||
AC_PROG_CXX
|
||||
|
||||
AC_DEFINE([API_VERSION], [17], [api version])
|
||||
AC_DEFINE([API_VERSION], [18], [api version])
|
||||
|
||||
# Filter out unwanted flags added by autoconf on some systems, e.g. MacOS.
|
||||
TORRENT_REMOVE_UNWANTED(CXX, $CXX, -std=c++11 -std=gnu++11)
|
||||
@@ -48,7 +48,7 @@ if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
|
||||
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.1])
|
||||
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.2])
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
TORRENT_WITH_XMLRPC_C
|
||||
|
||||
+14
-4
@@ -4,20 +4,30 @@
|
||||
|
||||
# log.open_file = "log name", "file path"
|
||||
|
||||
log.open_file = "rtorrent.log", (cat,/tmp/rtorrent.log.,(system.pid))
|
||||
log.open_file = "rtorrent.log", (cat,/tmp/rtorrent.log.,(system.pid))
|
||||
|
||||
A newly opened log file is not connected to any logging events.
|
||||
|
||||
Some control over formatting will be provided at a later date.
|
||||
|
||||
## Appending to log files
|
||||
|
||||
log.append_file = "rtorrent.log", "/tmp/rtorrent.log"
|
||||
|
||||
The `log.open_file` clears any existing contents of the file. If you'd
|
||||
prefer to have a single log file that persists across application
|
||||
restarts, you can use the `log.append_file` in place of the
|
||||
`log.open_file` configuration key.
|
||||
|
||||
## Adding outputs to events
|
||||
|
||||
# log.add_output = "logging event", "log name"
|
||||
|
||||
log.add_output = "info", "rtorrent.log"
|
||||
|
||||
log.add_output = "dht_debug", "tracker.log"
|
||||
log.add_output = "tracker_debug", "tracker.log"
|
||||
log.add_output = "dht_all", "tracker.log"
|
||||
log.add_output = "tracker_events", "tracker.log"
|
||||
log.add_output = "tracker_requests", "tracker.log"
|
||||
|
||||
Each log handle can be added to multiple different logging events.
|
||||
|
||||
@@ -31,7 +41,7 @@ Each log handle can be added to multiple different logging events.
|
||||
"debug"
|
||||
|
||||
The above events receive logging events from all the sub-groups
|
||||
displayed below, and each event also reciving events from the event
|
||||
displayed below, and each event also receiving events from the event
|
||||
above in importance.
|
||||
|
||||
Thus some high-volume sub-group events such as “tracker\_debug” are not
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
\begin{verbatim}
|
||||
# log.open_file = "log name", "file path"
|
||||
|
||||
log.open_file = "rtorrent.log", (cat,/tmp/rtorrent.log.,(system.pid))
|
||||
log.open_file = "rtorrent.log", (cat,/tmp/rtorrent.log.,(system.pid))
|
||||
\end{verbatim}
|
||||
|
||||
A newly opened log file is not connected to any logging events.
|
||||
@@ -20,8 +20,9 @@ Some control over formatting will be provided at a later date.
|
||||
|
||||
log.add_output = "info", "rtorrent.log"
|
||||
|
||||
log.add_output = "dht_debug", "tracker.log"
|
||||
log.add_output = "tracker_debug", "tracker.log"
|
||||
log.add_output = "dht_all", "tracker.log"
|
||||
log.add_output = "tracker_events", "tracker.log"
|
||||
log.add_output = "tracker_requests", "tracker.log"
|
||||
\end{verbatim}
|
||||
|
||||
Each log handle can be added to multiple different logging events.
|
||||
|
||||
@@ -101,8 +101,11 @@ schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torre
|
||||
# Levels = critical error warn notice info debug
|
||||
# Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
|
||||
print = (cat, "Logging to ", (cfg.logfile))
|
||||
|
||||
log.open_file = "log", (cfg.logfile)
|
||||
|
||||
log.add_output = "info", "log"
|
||||
##log.add_output = "tracker_debug", "log"
|
||||
#log.add_output = "tracker_events", "log"
|
||||
#log.add_output = "tracker_requests", "log"
|
||||
|
||||
### END of rtorrent.rc ###
|
||||
|
||||
@@ -136,6 +136,7 @@ rc.schedule2('watch_load', '11', '10', 'load.verbose=(cat, (cfg.watch), "load/*.
|
||||
rc.print('Logging to '..rc.cfg.logfile())
|
||||
rc.log.open_file('log', rc.cfg.logfile())
|
||||
rc.log.add_output('info', 'log')
|
||||
--rc.log.add_output('tracker_debug', 'log')
|
||||
--rc.log.add_output('tracker_events', 'log')
|
||||
--rc.log.add_output('tracker_requests', 'log')
|
||||
|
||||
--[[ END of rtorrent.rc.lua ]]--
|
||||
|
||||
+2
-1
@@ -30,7 +30,8 @@ AC_DEFUN([TORRENT_REMOVE_UNWANTED],
|
||||
$1="$2"
|
||||
else
|
||||
result=`echo "${values_to_check}" | $GREP -Fvx -- "${unwanted_values}" | $GREP -v '^$'`
|
||||
$1=$(echo "$result" | tr -d '\n')
|
||||
# join with spaces, squeeze repeats, and trim trailing space
|
||||
$1=$(printf '%s\n' "$result" | tr '\n' ' ' | sed 's/ */ /g; s/ *$//')
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -1,37 +1,3 @@
|
||||
// rTorrent - BitTorrent client
|
||||
// Copyright (C) 2005-2011, Jari Sundell
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// In addition, as a special exception, the copyright holders give
|
||||
// permission to link the code of portions of this program with the
|
||||
// OpenSSL library under certain conditions as described in each
|
||||
// individual source file, and distribute linked combinations
|
||||
// including the two.
|
||||
//
|
||||
// You must obey the GNU General Public License in all respects for
|
||||
// all of the code used other than OpenSSL. If you modify file(s)
|
||||
// with this exception, you may extend this exception to your version
|
||||
// of the file(s), but you are not obligated to do so. If you do not
|
||||
// wish to do so, delete this exception statement from your version.
|
||||
// If you delete this exception statement from all source files in the
|
||||
// program, then also delete it here.
|
||||
//
|
||||
// Contact: Jari Sundell <sundell.software@gmail.com>
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <torrent/exceptions.h>
|
||||
|
||||
@@ -104,8 +104,10 @@ void initialize_commands();
|
||||
rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_rpc | rpc::CommandMap::flag_dont_delete);
|
||||
#define CMD2_REDIRECT_NO_EXPORT(from_key, to_key) \
|
||||
rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_dont_delete);
|
||||
#define CMD2_REDIRECT_MUTABLE(from_key, to_key) \
|
||||
rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_rpc);
|
||||
#define CMD2_REDIRECT_STR(from_key, to_key) \
|
||||
rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_rpc;
|
||||
rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_rpc);
|
||||
#define CMD2_REDIRECT_STR_NO_EXPORT(from_key, to_key) \
|
||||
rpc::commands.create_redirect(from_key, to_key, 0);
|
||||
#define CMD2_REDIRECT_FILE(from_key, to_key) \
|
||||
|
||||
@@ -124,14 +124,14 @@ group_insert(const torrent::Object::list_type& args) {
|
||||
if (rpc::call_command_value("method.use_intermediate") == 3) {
|
||||
// Cleaned up in 0.16.1:
|
||||
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".view", "group." + name + ".view");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".view.set", "group." + name + ".view.set");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".ratio.min", "group." + name + ".ratio.min");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".ratio.min.set", "group." + name + ".ratio.min.set");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".ratio.max", "group." + name + ".ratio.max");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".ratio.max.set", "group." + name + ".ratio.max.set");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".ratio.upload", "group." + name + ".ratio.upload");
|
||||
CMD2_REDIRECT_STR_NO_EXPORT("group2." + name + ".ratio.upload.set", "group." + name + ".ratio.upload.set");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".view", "group." + name + ".view");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".view.set", "group." + name + ".view.set");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".ratio.min", "group." + name + ".ratio.min");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".ratio.min.set", "group." + name + ".ratio.min.set");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".ratio.max", "group." + name + ".ratio.max");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".ratio.max.set", "group." + name + ".ratio.max.set");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".ratio.upload", "group." + name + ".ratio.upload");
|
||||
CMD2_REDIRECT_MUTABLE("group2." + name + ".ratio.upload.set", "group." + name + ".ratio.upload.set");
|
||||
}
|
||||
|
||||
return name;
|
||||
|
||||
+42
-41
@@ -7,11 +7,11 @@
|
||||
#include <rak/path.h>
|
||||
#include <torrent/torrent.h>
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/connection_manager.h>
|
||||
#include <torrent/data/file_manager.h>
|
||||
#include <torrent/download/resource_manager.h>
|
||||
#include <torrent/net/http_stack.h>
|
||||
#include <torrent/net/network_config.h>
|
||||
#include <torrent/net/network_manager.h>
|
||||
#include <torrent/net/socket_address.h>
|
||||
#include <torrent/tracker/tracker.h>
|
||||
#include <torrent/utils/log.h>
|
||||
@@ -168,7 +168,8 @@ initialize_command_network() {
|
||||
auto cm = torrent::connection_manager();
|
||||
auto file_manager = torrent::file_manager();
|
||||
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));
|
||||
|
||||
@@ -177,18 +178,18 @@ initialize_command_network() {
|
||||
CMD2_VAR_BOOL ("network.port_random", true);
|
||||
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.backlog", std::bind(&torrent::net::NetworkConfig::listen_backlog, network_config));
|
||||
CMD2_ANY_VALUE_V ("network.listen.backlog.set", std::bind(&torrent::ConnectionManager::set_listen_backlog, cm, std::placeholders::_2));
|
||||
CMD2_ANY ("network.listen.port", [nw_manager](auto, auto) { return nw_manager->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", std::bind(&apply_encryption, std::placeholders::_2));
|
||||
CMD2_VAR_BOOL ("protocol.pex", true);
|
||||
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");
|
||||
CMD2_VAR_STRING ("protocol.connection.leech", "leech");
|
||||
CMD2_VAR_STRING ("protocol.connection.seed", "seed");
|
||||
|
||||
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.leech", "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.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_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_VALUE_V ("network.send_buffer.size.set", [network_config](auto, auto& value) { return network_config->set_send_buffer_size(value); });
|
||||
CMD2_ANY ("network.receive_buffer.size", [network_config](auto, auto) { return network_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 ("network.send_buffer.size", [nw_config](auto, auto) { return nw_config->send_buffer_size(); });
|
||||
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", [nw_config](auto, auto) { return nw_config->receive_buffer_size(); });
|
||||
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 ("network.bind_address", [network_config](auto, auto) { return network_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 ("network.bind_address.ipv4", [network_config](auto, auto) { return network_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 ("network.bind_address.ipv6", [network_config](auto, auto) { return network_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 ("network.bind_address", [nw_config](auto, auto) { return nw_config->bind_address_best_match_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", [nw_config](auto, auto) { return nw_config->bind_inet_address_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", [nw_config](auto, auto) { return nw_config->bind_inet6_address_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_STRING_V("network.local_address.set", [network_config](auto, auto& str) { return network_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_STRING_V("network.local_address.ipv4.set", [network_config](auto, auto& str) { return network_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_STRING_V("network.local_address.ipv6.set", [network_config](auto, auto& str) { return network_config->set_local_inet6_address_str(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", [nw_config](auto, auto& str) { return nw_config->set_local_address_str(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", [nw_config](auto, auto& str) { return nw_config->set_local_inet_address_str(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", [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_STRING_V("network.proxy_address.set", [](auto, auto& str) { return control->core()->set_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 ("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(); });
|
||||
@@ -248,20 +249,20 @@ initialize_command_network() {
|
||||
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 ("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 ("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_VAR_BOOL ("network.rpc.use_xmlrpc", 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_VALUE_V ("network.block.ipv4.set", [network_config](auto, auto& value) { return network_config->set_block_ipv4(value); });
|
||||
CMD2_ANY ("network.block.ipv6", [network_config](auto, auto) { return network_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 ("network.block.ipv4in6", [network_config](auto, auto) { return network_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 ("network.block.outgoing", [network_config](auto, auto) { return network_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 ("network.prefer.ipv6", [network_config](auto, auto) { return network_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 ("network.block.ipv4", [nw_config](auto, auto) { return nw_config->is_block_ipv4(); });
|
||||
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", [nw_config](auto, auto) { return nw_config->is_block_ipv6(); });
|
||||
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", [nw_config](auto, auto) { return nw_config->is_block_ipv4in6(); });
|
||||
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", [nw_config](auto, auto) { return nw_config->is_block_outgoing(); });
|
||||
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", [nw_config](auto, auto) { return nw_config->is_prefer_ipv6(); });
|
||||
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 <sys/stat.h>
|
||||
#include <torrent/connection_manager.h>
|
||||
#include <torrent/net/http_stack.h>
|
||||
#include <torrent/net/network_manager.h>
|
||||
#include <torrent/utils/directory_events.h>
|
||||
|
||||
#include "core/dht_manager.h"
|
||||
@@ -38,9 +38,9 @@ Control::Control()
|
||||
m_lua_engine(new rpc::LuaEngine()),
|
||||
m_directory_events(new torrent::directory_events()) {
|
||||
|
||||
m_core = std::make_unique<core::Manager>();
|
||||
m_viewManager = std::make_unique<core::ViewManager>();
|
||||
m_dhtManager = std::make_unique<core::DhtManager>();
|
||||
m_core = std::make_unique<core::Manager>();
|
||||
m_view_manager = std::make_unique<core::ViewManager>();
|
||||
m_dht_manager = std::make_unique<core::DhtManager>();
|
||||
|
||||
m_inputStdin->slot_pressed(std::bind(&input::Manager::pressed, m_input.get(), std::placeholders::_1));
|
||||
|
||||
@@ -50,7 +50,7 @@ Control::Control()
|
||||
}
|
||||
|
||||
Control::~Control() {
|
||||
m_viewManager.reset();
|
||||
m_view_manager.reset();
|
||||
|
||||
m_ui.reset();
|
||||
m_display.reset();
|
||||
@@ -67,7 +67,7 @@ Control::initialize() {
|
||||
|
||||
m_core->listen_open();
|
||||
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);
|
||||
|
||||
@@ -126,7 +126,7 @@ Control::handle_shutdown() {
|
||||
if (worker_thread->is_active())
|
||||
worker_thread->stop_thread_wait();
|
||||
|
||||
torrent::connection_manager()->listen_close();
|
||||
torrent::runtime::network_manager()->listen_close();
|
||||
|
||||
m_directory_events->close();
|
||||
m_core->shutdown(false);
|
||||
|
||||
+4
-4
@@ -57,8 +57,8 @@ public:
|
||||
void receive_quick_shutdown() { m_shutdownReceived = true; m_shutdownQuick = true; }
|
||||
|
||||
core::Manager* core() { return m_core.get(); }
|
||||
core::ViewManager* view_manager() { return m_viewManager.get(); }
|
||||
core::DhtManager* dht_manager() { return m_dhtManager.get(); }
|
||||
core::ViewManager* view_manager() { return m_view_manager.get(); }
|
||||
core::DhtManager* dht_manager() { return m_dht_manager.get(); }
|
||||
|
||||
ui::Root* ui() { return m_ui.get(); }
|
||||
display::Manager* display() { return m_display.get(); }
|
||||
@@ -82,8 +82,8 @@ private:
|
||||
void operator = (const Control&);
|
||||
|
||||
std::unique_ptr<core::Manager> m_core;
|
||||
std::unique_ptr<core::ViewManager> m_viewManager;
|
||||
std::unique_ptr<core::DhtManager> m_dhtManager;
|
||||
std::unique_ptr<core::ViewManager> m_view_manager;
|
||||
std::unique_ptr<core::DhtManager> m_dht_manager;
|
||||
|
||||
std::unique_ptr<ui::Root> m_ui;
|
||||
std::unique_ptr<display::Manager> m_display;
|
||||
|
||||
+4
-3
@@ -19,6 +19,7 @@
|
||||
#include <torrent/throttle.h>
|
||||
#include <torrent/net/http_stack.h>
|
||||
#include <torrent/net/network_config.h>
|
||||
#include <torrent/net/network_manager.h>
|
||||
#include <torrent/net/socket_address.h>
|
||||
#include <torrent/utils/log.h>
|
||||
|
||||
@@ -175,12 +176,12 @@ Manager::listen_open() {
|
||||
if (rpc::call_command_value("network.port_random")) {
|
||||
int boundary = portFirst + random() % (portLast - portFirst + 1);
|
||||
|
||||
if (torrent::connection_manager()->listen_open(boundary, portLast) ||
|
||||
torrent::connection_manager()->listen_open(portFirst, boundary))
|
||||
if (torrent::runtime::network_manager()->listen_open(boundary, portLast) ||
|
||||
torrent::runtime::network_manager()->listen_open(portFirst, boundary))
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (torrent::connection_manager()->listen_open(portFirst, portLast))
|
||||
if (torrent::runtime::network_manager()->listen_open(portFirst, portLast))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+18
-4
@@ -17,6 +17,7 @@
|
||||
#include <torrent/download/resource_manager.h>
|
||||
#include <torrent/net/http_stack.h>
|
||||
#include <torrent/net/network_config.h>
|
||||
#include <torrent/net/network_manager.h>
|
||||
#include <torrent/net/socket_address.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, " [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();
|
||||
|
||||
@@ -388,11 +389,24 @@ 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_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_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, "]");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "config.h"
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
Reference in New Issue
Block a user