mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
* Enforce an http transfer timeout when libcurl fails to honor
it. Also set a 5-minute timeout for (previously unlimited) torrent transfers and fixes the argument type for curl_easy_setopt values. * Allows bandwidth throttles to work without floating point support. * Adds a d.add_peer=host[:port] command to manually add a peer (not for torrents marked "private"), port is 6881 by default. * Allows banning the selected peer with "B". No unbanning is possible yet. All the above patches were written by Josef Drexler. * Differentiate between commands that have no target, and those that take generic targets, when using XMLRPC. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1073 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -77,7 +77,7 @@ CommandFunctionList::find(const char* key) {
|
||||
|
||||
void
|
||||
CommandFunctionList::insert(const std::string& key, const std::string& cmd) {
|
||||
base_type::iterator itr = std::find_if(begin(), end(), rak::greater_equal(key, rak::mem_ref(&base_type::value_type::first)));
|
||||
base_type::iterator itr = std::find_if(begin(), end(), rak::less_equal(key, rak::mem_ref(&base_type::value_type::first)));
|
||||
|
||||
if (itr != end() && itr->first == key)
|
||||
itr->second = cmd;
|
||||
|
||||
@@ -102,7 +102,8 @@ public:
|
||||
static const int flag_dont_delete = 0x1;
|
||||
static const int flag_delete_key = 0x2;
|
||||
static const int flag_public_xmlrpc = 0x4;
|
||||
static const int flag_modifiable = 0x8;
|
||||
static const int flag_no_target = 0x8;
|
||||
static const int flag_modifiable = 0x10;
|
||||
|
||||
CommandMap() {}
|
||||
~CommandMap();
|
||||
|
||||
+4
-1
@@ -417,7 +417,10 @@ xmlrpc_call_command(xmlrpc_env* env, xmlrpc_value* args, void* voidServerInfo) {
|
||||
torrent::Object object;
|
||||
rpc::target_type target = rpc::make_target();
|
||||
|
||||
xmlrpc_to_object(env, args, itr->second.target(), &target).swap(object);
|
||||
if (itr->second.m_flags & CommandMap::flag_no_target)
|
||||
xmlrpc_to_object(env, args, XmlRpc::call_generic, &target).swap(object);
|
||||
else
|
||||
xmlrpc_to_object(env, args, itr->second.target(), &target).swap(object);
|
||||
|
||||
if (env->fault_occurred)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user