mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-17 06:36:18 +00:00
Merge branch 'master' into c++11
Conflicts: src/command_dynamic.cc src/command_events.cc src/command_groups.cc src/command_ip.cc src/command_network.cc
This commit is contained in:
@@ -32,6 +32,8 @@ libtool
|
|||||||
ltmain.sh
|
ltmain.sh
|
||||||
missing
|
missing
|
||||||
stamp-h1
|
stamp-h1
|
||||||
|
|
||||||
|
src/rtorrent
|
||||||
scripts/libtool.m4
|
scripts/libtool.m4
|
||||||
scripts/lt*.m4
|
scripts/lt*.m4
|
||||||
|
|
||||||
|
|||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
PORT_NUMBER=${1:-5001}
|
||||||
|
|
||||||
|
echo "Option Strings"
|
||||||
|
echo "=============="
|
||||||
|
echo
|
||||||
|
echo "Introduction"
|
||||||
|
echo "------------"
|
||||||
|
echo
|
||||||
|
echo "Client version: " `xmlrpc2scgi.py -p scgi://127.0.0.1:${PORT_NUMBER} system.client_version`
|
||||||
|
echo
|
||||||
|
echo "Generated by 'rtorrent/doc/scripts/print_option_string.sh' on `date -u`."
|
||||||
|
|
||||||
|
for i in strings.choke_heuristics strings.choke_heuristics.upload strings.choke_heuristics.download strings.connection_type strings.encryption strings.ip_filter strings.ip_tos strings.log_group strings.tracker_event strings.tracker_mode; do
|
||||||
|
echo
|
||||||
|
echo $i
|
||||||
|
echo `echo $i | tr 'a-z_.' '-'`
|
||||||
|
echo
|
||||||
|
echo '```'
|
||||||
|
xmlrpc2scgi.py -p scgi://127.0.0.1:${PORT_NUMBER} $i | tr , '\n' | tr '[' ' ' | tr ']' ' '
|
||||||
|
echo '```'
|
||||||
|
done
|
||||||
File diff suppressed because it is too large
Load Diff
+13
-1
@@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <torrent/utils/log.h>
|
#include <torrent/utils/log.h>
|
||||||
|
#include <torrent/utils/option_strings.h>
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
@@ -438,7 +439,7 @@ cmd_catch(rpc::target_type target, const torrent::Object& args) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
initialize_command_dynamic() {
|
initialize_command_dynamic() {
|
||||||
CMD2_VAR_BOOL ("method.use_deprecated", true);
|
CMD2_VAR_BOOL ("method.use_deprecated", false);
|
||||||
CMD2_VAR_VALUE ("method.use_intermediate", 1);
|
CMD2_VAR_VALUE ("method.use_intermediate", 1);
|
||||||
|
|
||||||
CMD2_ANY_LIST ("method.insert", std::bind(&system_method_insert, std::placeholders::_2));
|
CMD2_ANY_LIST ("method.insert", std::bind(&system_method_insert, std::placeholders::_2));
|
||||||
@@ -468,4 +469,15 @@ initialize_command_dynamic() {
|
|||||||
CMD2_ANY_STRING_V("method.rlookup.clear", std::bind(&rpc::object_storage::rlookup_clear, control->object_storage(), std::placeholders::_2));
|
CMD2_ANY_STRING_V("method.rlookup.clear", std::bind(&rpc::object_storage::rlookup_clear, control->object_storage(), std::placeholders::_2));
|
||||||
|
|
||||||
CMD2_ANY ("catch", std::bind(&cmd_catch, std::placeholders::_1, std::placeholders::_2));
|
CMD2_ANY ("catch", std::bind(&cmd_catch, std::placeholders::_1, std::placeholders::_2));
|
||||||
|
|
||||||
|
CMD2_ANY ("strings.choke_heuristics", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS));
|
||||||
|
CMD2_ANY ("strings.choke_heuristics.upload", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_UPLOAD));
|
||||||
|
CMD2_ANY ("strings.choke_heuristics.download", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_DOWNLOAD));
|
||||||
|
CMD2_ANY ("strings.connection_type", std::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
|
||||||
|
CMD2_ANY ("strings.encryption", std::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
|
||||||
|
CMD2_ANY ("strings.ip_filter", std::bind(&torrent::option_list_strings, torrent::OPTION_IP_FILTER));
|
||||||
|
CMD2_ANY ("strings.ip_tos", std::bind(&torrent::option_list_strings, torrent::OPTION_IP_TOS));
|
||||||
|
CMD2_ANY ("strings.log_group", std::bind(&torrent::option_list_strings, torrent::OPTION_LOG_GROUP));
|
||||||
|
CMD2_ANY ("strings.tracker_event", std::bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_EVENT));
|
||||||
|
CMD2_ANY ("strings.tracker_mode", std::bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_MODE));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,12 +38,14 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <rak/error_number.h>
|
||||||
#include <rak/file_stat.h>
|
#include <rak/file_stat.h>
|
||||||
#include <rak/path.h>
|
#include <rak/path.h>
|
||||||
#include <rak/string_manip.h>
|
#include <rak/string_manip.h>
|
||||||
#include <torrent/rate.h>
|
#include <torrent/rate.h>
|
||||||
#include <torrent/hash_string.h>
|
#include <torrent/hash_string.h>
|
||||||
#include <torrent/utils/log.h>
|
#include <torrent/utils/log.h>
|
||||||
|
#include <torrent/utils/directory_events.h>
|
||||||
|
|
||||||
#include "core/download.h"
|
#include "core/download.h"
|
||||||
#include "core/download_list.h"
|
#include "core/download_list.h"
|
||||||
@@ -305,6 +307,28 @@ d_multicall(const torrent::Object::list_type& args) {
|
|||||||
return resultRaw;
|
return resultRaw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_watch_command(const std::string& command, const std::string& path) {
|
||||||
|
rpc::commands.call_catch(command.c_str(), rpc::make_target(), path);
|
||||||
|
}
|
||||||
|
|
||||||
|
torrent::Object
|
||||||
|
directory_watch_added(const torrent::Object::list_type& args) {
|
||||||
|
if (args.size() != 2)
|
||||||
|
throw torrent::input_error("Too few arguments.");
|
||||||
|
|
||||||
|
const std::string& path = args.front().as_string();
|
||||||
|
const std::string& command = args.back().as_string();
|
||||||
|
|
||||||
|
if (!control->directory_events()->open())
|
||||||
|
throw torrent::input_error("Could not open inotify:" + std::string(rak::error_number::current().c_str()));
|
||||||
|
|
||||||
|
control->directory_events()->notify_on(path.c_str(),
|
||||||
|
torrent::directory_events::flag_on_added | torrent::directory_events::flag_on_updated,
|
||||||
|
std::bind(&call_watch_command, command, std::placeholders::_1));
|
||||||
|
return torrent::Object();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
initialize_command_events() {
|
initialize_command_events() {
|
||||||
CMD2_ANY_STRING ("on_ratio", std::bind(&apply_on_ratio, std::placeholders::_2));
|
CMD2_ANY_STRING ("on_ratio", std::bind(&apply_on_ratio, std::placeholders::_2));
|
||||||
@@ -334,4 +358,6 @@ initialize_command_events() {
|
|||||||
|
|
||||||
CMD2_ANY_LIST ("download_list", std::bind(&apply_download_list, std::placeholders::_2));
|
CMD2_ANY_LIST ("download_list", std::bind(&apply_download_list, std::placeholders::_2));
|
||||||
CMD2_ANY_LIST ("d.multicall2", std::bind(&d_multicall, std::placeholders::_2));
|
CMD2_ANY_LIST ("d.multicall2", std::bind(&d_multicall, std::placeholders::_2));
|
||||||
|
|
||||||
|
CMD2_ANY_LIST ("directory.watch.added", std::bind(&directory_watch_added, std::placeholders::_2));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,15 +335,9 @@ options.
|
|||||||
|
|
||||||
void
|
void
|
||||||
initialize_command_groups() {
|
initialize_command_groups() {
|
||||||
// Move somewhere else?
|
|
||||||
CMD2_ANY ("strings.choke_heuristics", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS));
|
|
||||||
CMD2_ANY ("strings.choke_heuristics.upload", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_UPLOAD));
|
|
||||||
CMD2_ANY ("strings.choke_heuristics.download", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_DOWNLOAD));
|
|
||||||
CMD2_ANY ("strings.tracker_mode", std::bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_MODE));
|
|
||||||
|
|
||||||
CMD2_ANY ("choke_group.list", std::bind(&apply_cg_list));
|
CMD2_ANY ("choke_group.list", std::bind(&apply_cg_list));
|
||||||
CMD2_ANY_STRING ("choke_group.insert", std::bind(&apply_cg_insert, std::placeholders::_2));
|
CMD2_ANY_STRING ("choke_group.insert", std::bind(&apply_cg_insert, std::placeholders::_2));
|
||||||
|
|
||||||
#if USE_CHOKE_GROUP
|
#if USE_CHOKE_GROUP
|
||||||
CMD2_ANY ("choke_group.size", std::bind(&torrent::ResourceManager::group_size, torrent::resource_manager()));
|
CMD2_ANY ("choke_group.size", std::bind(&torrent::ResourceManager::group_size, torrent::resource_manager()));
|
||||||
CMD2_ANY_STRING ("choke_group.index_of", std::bind(&torrent::ResourceManager::group_index_of, torrent::resource_manager(), std::placeholders::_2));
|
CMD2_ANY_STRING ("choke_group.index_of", std::bind(&torrent::ResourceManager::group_index_of, torrent::resource_manager(), std::placeholders::_2));
|
||||||
|
|||||||
@@ -281,9 +281,6 @@ apply_ipv4_filter_dump() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
initialize_command_ip() {
|
initialize_command_ip() {
|
||||||
CMD2_ANY ("strings.ip_filter", std::bind(&torrent::option_list_strings, torrent::OPTION_IP_FILTER));
|
|
||||||
CMD2_ANY ("strings.ip_tos", std::bind(&torrent::option_list_strings, torrent::OPTION_IP_TOS));
|
|
||||||
|
|
||||||
CMD2_ANY_STRING ("ip_tables.insert_table", std::bind(&apply_ip_tables_insert_table, std::placeholders::_2));
|
CMD2_ANY_STRING ("ip_tables.insert_table", std::bind(&apply_ip_tables_insert_table, std::placeholders::_2));
|
||||||
CMD2_ANY_STRING ("ip_tables.size_data", std::bind(&apply_ip_tables_size_data, std::placeholders::_2));
|
CMD2_ANY_STRING ("ip_tables.size_data", std::bind(&apply_ip_tables_size_data, std::placeholders::_2));
|
||||||
CMD2_ANY_LIST ("ip_tables.get", std::bind(&apply_ip_tables_get, std::placeholders::_2));
|
CMD2_ANY_LIST ("ip_tables.get", std::bind(&apply_ip_tables_get, std::placeholders::_2));
|
||||||
|
|||||||
+10
-12
@@ -236,10 +236,6 @@ initialize_command_network() {
|
|||||||
torrent::FileManager* fileManager = torrent::file_manager();
|
torrent::FileManager* fileManager = torrent::file_manager();
|
||||||
core::CurlStack* httpStack = control->core()->http_stack();
|
core::CurlStack* httpStack = control->core()->http_stack();
|
||||||
|
|
||||||
CMD2_ANY ("strings.connection_type", std::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
|
|
||||||
CMD2_ANY ("strings.encryption", std::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
|
|
||||||
|
|
||||||
// CMD2_ANY_STRING ("encoding_list", std::bind(&apply_encoding_list, std::placeholders::_2));
|
|
||||||
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));
|
||||||
|
|
||||||
// Isn't port_open used?
|
// Isn't port_open used?
|
||||||
@@ -262,18 +258,20 @@ initialize_command_network() {
|
|||||||
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");
|
||||||
|
|
||||||
CMD2_ANY ("network.http.capath", std::bind(&core::CurlStack::http_capath, httpStack));
|
|
||||||
CMD2_ANY_STRING_V("network.http.capath.set", std::bind(&core::CurlStack::set_http_capath, httpStack, std::placeholders::_2));
|
|
||||||
CMD2_ANY ("network.http.cacert", std::bind(&core::CurlStack::http_cacert, httpStack));
|
CMD2_ANY ("network.http.cacert", std::bind(&core::CurlStack::http_cacert, httpStack));
|
||||||
CMD2_ANY_STRING_V("network.http.cacert.set", std::bind(&core::CurlStack::set_http_cacert, httpStack, std::placeholders::_2));
|
CMD2_ANY_STRING_V("network.http.cacert.set", std::bind(&core::CurlStack::set_http_cacert, httpStack, std::placeholders::_2));
|
||||||
CMD2_ANY ("network.http.proxy_address", std::bind(&core::CurlStack::http_proxy, httpStack));
|
CMD2_ANY ("network.http.capath", std::bind(&core::CurlStack::http_capath, httpStack));
|
||||||
CMD2_ANY_STRING_V("network.http.proxy_address.set", std::bind(&core::CurlStack::set_http_proxy, httpStack, std::placeholders::_2));
|
CMD2_ANY_STRING_V("network.http.capath.set", std::bind(&core::CurlStack::set_http_capath, httpStack, std::placeholders::_2));
|
||||||
CMD2_ANY ("network.http.max_open", std::bind(&core::CurlStack::max_active, httpStack));
|
|
||||||
CMD2_ANY_VALUE_V ("network.http.max_open.set", std::bind(&core::CurlStack::set_max_active, httpStack, std::placeholders::_2));
|
|
||||||
CMD2_ANY ("network.http.ssl_verify_peer", std::bind(&core::CurlStack::ssl_verify_peer, httpStack));
|
|
||||||
CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set", std::bind(&core::CurlStack::set_ssl_verify_peer, httpStack, std::placeholders::_2));
|
|
||||||
CMD2_ANY ("network.http.dns_cache_timeout", std::bind(&core::CurlStack::dns_timeout, httpStack));
|
CMD2_ANY ("network.http.dns_cache_timeout", std::bind(&core::CurlStack::dns_timeout, httpStack));
|
||||||
CMD2_ANY_VALUE_V ("network.http.dns_cache_timeout.set", std::bind(&core::CurlStack::set_dns_timeout, httpStack, std::placeholders::_2));
|
CMD2_ANY_VALUE_V ("network.http.dns_cache_timeout.set", std::bind(&core::CurlStack::set_dns_timeout, httpStack, std::placeholders::_2));
|
||||||
|
CMD2_ANY ("network.http.max_open", std::bind(&core::CurlStack::max_active, httpStack));
|
||||||
|
CMD2_ANY_VALUE_V ("network.http.max_open.set", std::bind(&core::CurlStack::set_max_active, httpStack, std::placeholders::_2));
|
||||||
|
CMD2_ANY ("network.http.proxy_address", std::bind(&core::CurlStack::http_proxy, httpStack));
|
||||||
|
CMD2_ANY_STRING_V("network.http.proxy_address.set", std::bind(&core::CurlStack::set_http_proxy, httpStack, std::placeholders::_2));
|
||||||
|
CMD2_ANY ("network.http.ssl_verify_host", std::bind(&core::CurlStack::ssl_verify_host, httpStack));
|
||||||
|
CMD2_ANY_VALUE_V ("network.http.ssl_verify_host.set", std::bind(&core::CurlStack::set_ssl_verify_host, httpStack, std::placeholders::_2));
|
||||||
|
CMD2_ANY ("network.http.ssl_verify_peer", std::bind(&core::CurlStack::ssl_verify_peer, httpStack));
|
||||||
|
CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set", std::bind(&core::CurlStack::set_ssl_verify_peer, httpStack, std::placeholders::_2));
|
||||||
|
|
||||||
CMD2_ANY ("network.send_buffer.size", std::bind(&torrent::ConnectionManager::send_buffer_size, cm));
|
CMD2_ANY ("network.send_buffer.size", std::bind(&torrent::ConnectionManager::send_buffer_size, cm));
|
||||||
CMD2_ANY_VALUE_V ("network.send_buffer.size.set", std::bind(&torrent::ConnectionManager::set_send_buffer_size, cm, std::placeholders::_2));
|
CMD2_ANY_VALUE_V ("network.send_buffer.size.set", std::bind(&torrent::ConnectionManager::set_send_buffer_size, cm, std::placeholders::_2));
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <torrent/connection_manager.h>
|
#include <torrent/connection_manager.h>
|
||||||
|
#include <torrent/utils/directory_events.h>
|
||||||
|
|
||||||
#include "core/manager.h"
|
#include "core/manager.h"
|
||||||
#include "core/download_store.h"
|
#include "core/download_store.h"
|
||||||
@@ -67,6 +68,7 @@ Control::Control() :
|
|||||||
|
|
||||||
m_commandScheduler(new rpc::CommandScheduler()),
|
m_commandScheduler(new rpc::CommandScheduler()),
|
||||||
m_objectStorage(new rpc::object_storage()),
|
m_objectStorage(new rpc::object_storage()),
|
||||||
|
m_directory_events(new torrent::directory_events()),
|
||||||
|
|
||||||
m_tick(0),
|
m_tick(0),
|
||||||
m_shutdownReceived(false),
|
m_shutdownReceived(false),
|
||||||
@@ -94,6 +96,7 @@ Control::~Control() {
|
|||||||
delete m_core;
|
delete m_core;
|
||||||
delete m_dhtManager;
|
delete m_dhtManager;
|
||||||
|
|
||||||
|
delete m_directory_events;
|
||||||
delete m_commandScheduler;
|
delete m_commandScheduler;
|
||||||
delete m_objectStorage;
|
delete m_objectStorage;
|
||||||
}
|
}
|
||||||
@@ -167,6 +170,7 @@ Control::handle_shutdown() {
|
|||||||
worker_thread->queue_item(&ThreadBase::stop_thread);
|
worker_thread->queue_item(&ThreadBase::stop_thread);
|
||||||
|
|
||||||
torrent::connection_manager()->listen_close();
|
torrent::connection_manager()->listen_close();
|
||||||
|
m_directory_events->close();
|
||||||
m_core->shutdown(false);
|
m_core->shutdown(false);
|
||||||
|
|
||||||
if (!m_taskShutdown.is_queued())
|
if (!m_taskShutdown.is_queued())
|
||||||
|
|||||||
+9
-2
@@ -68,6 +68,10 @@ namespace rpc {
|
|||||||
class object_storage;
|
class object_storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace torrent {
|
||||||
|
class directory_events;
|
||||||
|
}
|
||||||
|
|
||||||
class Control {
|
class Control {
|
||||||
public:
|
public:
|
||||||
Control();
|
Control();
|
||||||
@@ -98,6 +102,8 @@ public:
|
|||||||
rpc::CommandScheduler* command_scheduler() { return m_commandScheduler; }
|
rpc::CommandScheduler* command_scheduler() { return m_commandScheduler; }
|
||||||
rpc::object_storage* object_storage() { return m_objectStorage; }
|
rpc::object_storage* object_storage() { return m_objectStorage; }
|
||||||
|
|
||||||
|
torrent::directory_events* directory_events() { return m_directory_events; }
|
||||||
|
|
||||||
uint64_t tick() const { return m_tick; }
|
uint64_t tick() const { return m_tick; }
|
||||||
void inc_tick() { m_tick++; }
|
void inc_tick() { m_tick++; }
|
||||||
|
|
||||||
@@ -117,8 +123,9 @@ private:
|
|||||||
input::Manager* m_input;
|
input::Manager* m_input;
|
||||||
input::InputEvent* m_inputStdin;
|
input::InputEvent* m_inputStdin;
|
||||||
|
|
||||||
rpc::CommandScheduler* m_commandScheduler;
|
rpc::CommandScheduler* m_commandScheduler;
|
||||||
rpc::object_storage* m_objectStorage;
|
rpc::object_storage* m_objectStorage;
|
||||||
|
torrent::directory_events* m_directory_events;
|
||||||
|
|
||||||
uint64_t m_tick;
|
uint64_t m_tick;
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ CurlStack::CurlStack() :
|
|||||||
m_handle((void*)curl_multi_init()),
|
m_handle((void*)curl_multi_init()),
|
||||||
m_active(0),
|
m_active(0),
|
||||||
m_maxActive(32),
|
m_maxActive(32),
|
||||||
|
m_ssl_verify_host(true),
|
||||||
m_ssl_verify_peer(true),
|
m_ssl_verify_peer(true),
|
||||||
m_dns_timeout(60) {
|
m_dns_timeout(60) {
|
||||||
|
|
||||||
@@ -180,7 +181,8 @@ CurlStack::add_get(CurlGet* get) {
|
|||||||
if (!m_httpCaCert.empty())
|
if (!m_httpCaCert.empty())
|
||||||
curl_easy_setopt(get->handle(), CURLOPT_CAINFO, m_httpCaCert.c_str());
|
curl_easy_setopt(get->handle(), CURLOPT_CAINFO, m_httpCaCert.c_str());
|
||||||
|
|
||||||
curl_easy_setopt(get->handle(), CURLOPT_SSL_VERIFYPEER, (long)m_ssl_verify_peer);
|
curl_easy_setopt(get->handle(), CURLOPT_SSL_VERIFYHOST, (long)(m_ssl_verify_host ? 2 : 0));
|
||||||
|
curl_easy_setopt(get->handle(), CURLOPT_SSL_VERIFYPEER, (long)(m_ssl_verify_peer ? 1 : 0));
|
||||||
curl_easy_setopt(get->handle(), CURLOPT_DNS_CACHE_TIMEOUT, m_dns_timeout);
|
curl_easy_setopt(get->handle(), CURLOPT_DNS_CACHE_TIMEOUT, m_dns_timeout);
|
||||||
|
|
||||||
base_type::push_back(get);
|
base_type::push_back(get);
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ class CurlStack : std::deque<CurlGet*> {
|
|||||||
void set_http_capath(const std::string& s) { m_httpCaPath = s; }
|
void set_http_capath(const std::string& s) { m_httpCaPath = s; }
|
||||||
void set_http_cacert(const std::string& s) { m_httpCaCert = s; }
|
void set_http_cacert(const std::string& s) { m_httpCaCert = s; }
|
||||||
|
|
||||||
|
bool ssl_verify_host() const { return m_ssl_verify_host; }
|
||||||
bool ssl_verify_peer() const { return m_ssl_verify_peer; }
|
bool ssl_verify_peer() const { return m_ssl_verify_peer; }
|
||||||
|
void set_ssl_verify_host(bool s) { m_ssl_verify_host = s; }
|
||||||
void set_ssl_verify_peer(bool s) { m_ssl_verify_peer = s; }
|
void set_ssl_verify_peer(bool s) { m_ssl_verify_peer = s; }
|
||||||
|
|
||||||
long dns_timeout() const { return m_dns_timeout; }
|
long dns_timeout() const { return m_dns_timeout; }
|
||||||
@@ -140,6 +142,7 @@ class CurlStack : std::deque<CurlGet*> {
|
|||||||
std::string m_httpCaPath;
|
std::string m_httpCaPath;
|
||||||
std::string m_httpCaCert;
|
std::string m_httpCaCert;
|
||||||
|
|
||||||
|
long m_ssl_verify_host;
|
||||||
bool m_ssl_verify_peer;
|
bool m_ssl_verify_peer;
|
||||||
long m_dns_timeout;
|
long m_dns_timeout;
|
||||||
};
|
};
|
||||||
|
|||||||
+17
-16
@@ -230,7 +230,7 @@ main(int argc, char** argv) {
|
|||||||
initialize_commands();
|
initialize_commands();
|
||||||
|
|
||||||
if (OptionParser::has_flag('D', argc, argv)) {
|
if (OptionParser::has_flag('D', argc, argv)) {
|
||||||
rpc::call_command_set_value("method.use_deprecated.set", false);
|
rpc::call_command_set_value("method.use_deprecated.set", true);
|
||||||
lt_log_print(torrent::LOG_WARN, "Disabled deprecated commands.");
|
lt_log_print(torrent::LOG_WARN, "Disabled deprecated commands.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,11 +394,26 @@ main(int argc, char** argv) {
|
|||||||
CMD2_REDIRECT ("port_random", "network.port_random.set");
|
CMD2_REDIRECT ("port_random", "network.port_random.set");
|
||||||
CMD2_REDIRECT ("proxy_address", "network.proxy_address.set");
|
CMD2_REDIRECT ("proxy_address", "network.proxy_address.set");
|
||||||
|
|
||||||
|
CMD2_REDIRECT ("scgi_port", "network.scgi.open_port");
|
||||||
|
CMD2_REDIRECT ("scgi_local", "network.scgi.open_local");
|
||||||
|
|
||||||
CMD2_REDIRECT_GENERIC("directory", "directory.default.set");
|
CMD2_REDIRECT_GENERIC("directory", "directory.default.set");
|
||||||
CMD2_REDIRECT_GENERIC("session", "session.path.set");
|
CMD2_REDIRECT_GENERIC("session", "session.path.set");
|
||||||
|
|
||||||
|
CMD2_REDIRECT ("check_hash", "pieces.hash.on_completion.set");
|
||||||
|
|
||||||
CMD2_REDIRECT ("key_layout", "keys.layout.set");
|
CMD2_REDIRECT ("key_layout", "keys.layout.set");
|
||||||
|
|
||||||
|
CMD2_REDIRECT_GENERIC("to_gm_time", "convert.gm_time");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_gm_date", "convert.gm_date");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_time", "convert.time");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_date", "convert.date");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_elapsed_time", "convert.elapsed_time");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_kb", "convert.kb");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_mb", "convert.mb");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_xb", "convert.xb");
|
||||||
|
CMD2_REDIRECT_GENERIC("to_throttle", "convert.throttle");
|
||||||
|
|
||||||
// Deprecated commands. Don't use these anymore.
|
// Deprecated commands. Don't use these anymore.
|
||||||
|
|
||||||
if (rpc::call_command_value("method.use_intermediate") == 1) {
|
if (rpc::call_command_value("method.use_intermediate") == 1) {
|
||||||
@@ -556,10 +571,6 @@ main(int argc, char** argv) {
|
|||||||
CMD2_REDIRECT_GENERIC("set_proxy_address", "network.proxy_address.set");
|
CMD2_REDIRECT_GENERIC("set_proxy_address", "network.proxy_address.set");
|
||||||
CMD2_REDIRECT ("get_proxy_address", "network.proxy_address");
|
CMD2_REDIRECT ("get_proxy_address", "network.proxy_address");
|
||||||
|
|
||||||
CMD2_REDIRECT ("scgi_port", "network.scgi.open_port");
|
|
||||||
CMD2_REDIRECT ("scgi_local", "network.scgi.open_local");
|
|
||||||
|
|
||||||
CMD2_REDIRECT ("scgi_dont_route", "network.scgi.dont_route.set");
|
|
||||||
CMD2_REDIRECT_GENERIC("set_scgi_dont_route", "network.scgi.dont_route.set");
|
CMD2_REDIRECT_GENERIC("set_scgi_dont_route", "network.scgi.dont_route.set");
|
||||||
CMD2_REDIRECT ("get_scgi_dont_route", "network.scgi.dont_route");
|
CMD2_REDIRECT ("get_scgi_dont_route", "network.scgi.dont_route");
|
||||||
|
|
||||||
@@ -634,7 +645,6 @@ main(int argc, char** argv) {
|
|||||||
CMD2_REDIRECT ("get_session_on_completion", "session.on_completion");
|
CMD2_REDIRECT ("get_session_on_completion", "session.on_completion");
|
||||||
CMD2_REDIRECT_GENERIC("set_session_on_completion", "session.on_completion.set");
|
CMD2_REDIRECT_GENERIC("set_session_on_completion", "session.on_completion.set");
|
||||||
|
|
||||||
CMD2_REDIRECT ("check_hash", "pieces.hash.on_completion.set");
|
|
||||||
CMD2_REDIRECT ("get_check_hash", "pieces.hash.on_completion");
|
CMD2_REDIRECT ("get_check_hash", "pieces.hash.on_completion");
|
||||||
CMD2_REDIRECT_GENERIC("set_check_hash", "pieces.hash.on_completion.set");
|
CMD2_REDIRECT_GENERIC("set_check_hash", "pieces.hash.on_completion.set");
|
||||||
|
|
||||||
@@ -809,16 +819,6 @@ main(int argc, char** argv) {
|
|||||||
// Rename these to avoid conflicts with old style.
|
// Rename these to avoid conflicts with old style.
|
||||||
CMD2_REDIRECT_GENERIC("d.multicall", "d.multicall2");
|
CMD2_REDIRECT_GENERIC("d.multicall", "d.multicall2");
|
||||||
|
|
||||||
CMD2_REDIRECT_GENERIC("to_gm_time", "convert.gm_time");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_gm_date", "convert.gm_date");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_time", "convert.time");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_date", "convert.date");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_elapsed_time", "convert.elapsed_time");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_kb", "convert.kb");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_mb", "convert.mb");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_xb", "convert.xb");
|
|
||||||
CMD2_REDIRECT_GENERIC("to_throttle", "convert.throttle");
|
|
||||||
|
|
||||||
CMD2_REDIRECT_GENERIC("execute_throw", "execute.throw");
|
CMD2_REDIRECT_GENERIC("execute_throw", "execute.throw");
|
||||||
CMD2_REDIRECT_GENERIC("execute_nothrow", "execute.nothrow");
|
CMD2_REDIRECT_GENERIC("execute_nothrow", "execute.nothrow");
|
||||||
CMD2_REDIRECT_GENERIC("execute_raw", "execute.raw");
|
CMD2_REDIRECT_GENERIC("execute_raw", "execute.raw");
|
||||||
@@ -1002,6 +1002,7 @@ print_help() {
|
|||||||
std::cout << "order. Use the up/down/left/right arrow keys to move between screens." << std::endl;
|
std::cout << "order. Use the up/down/left/right arrow keys to move between screens." << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << "Usage: rtorrent [OPTIONS]... [FILE]... [URL]..." << std::endl;
|
std::cout << "Usage: rtorrent [OPTIONS]... [FILE]... [URL]..." << std::endl;
|
||||||
|
std::cout << " -D Enable deprecated commands" << std::endl;
|
||||||
std::cout << " -h Display this very helpful text" << std::endl;
|
std::cout << " -h Display this very helpful text" << std::endl;
|
||||||
std::cout << " -n Don't try to load ~/.rtorrent.rc on startup" << std::endl;
|
std::cout << " -n Don't try to load ~/.rtorrent.rc on startup" << std::endl;
|
||||||
std::cout << " -b <a.b.c.d> Bind the listening socket to this IP" << std::endl;
|
std::cout << " -b <a.b.c.d> Bind the listening socket to this IP" << std::endl;
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ public:
|
|||||||
ThreadWorker();
|
ThreadWorker();
|
||||||
~ThreadWorker();
|
~ThreadWorker();
|
||||||
|
|
||||||
const char* name() const { return "worker_rtorrent"; }
|
const char* name() const { return "rtorrent scgi"; }
|
||||||
|
|
||||||
virtual void init_thread();
|
virtual void init_thread();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user