mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 04:32:30 +00:00
Allow using vendored tinyxml2 for XMLRPC
By default, builds will still not have XMLRPC enabled at all and the configure flag `--with-xmlrpc-tinyxml2` must be specified. If both xmlrpc-c and tinyxml2 are specified, xmlrpc-c takes precedence. Basic benchmarks indicate tinyxml2 is 2x faster for small requests/responses, and that only increases as response sizes get larger.
This commit is contained in:
@@ -136,6 +136,18 @@ system_method_generate_command2(torrent::Object* object, torrent::Object::list_c
|
||||
|
||||
// }
|
||||
|
||||
// This is only used by tinyxml2, xmlrpc-c intercepts the call internally
|
||||
torrent::Object
|
||||
system_listMethods() {
|
||||
torrent::Object resultRaw = torrent::Object::create_list();
|
||||
torrent::Object::list_type& result = resultRaw.as_list();
|
||||
result.push_back("system.multicall"); // Handled directly by the XMLRPC code
|
||||
for (auto itr : rpc::commands) {
|
||||
result.push_back(itr.first);
|
||||
}
|
||||
return resultRaw;
|
||||
}
|
||||
|
||||
torrent::Object
|
||||
system_method_insert_object(const torrent::Object::list_type& args, int flags) {
|
||||
if (args.empty())
|
||||
@@ -431,6 +443,10 @@ cmd_catch(rpc::target_type target, const torrent::Object& args) {
|
||||
void
|
||||
initialize_command_dynamic() {
|
||||
// clang-format off
|
||||
#ifndef HAVE_XMLRPC_C
|
||||
CMD2_ANY ("system.listMethods", std::bind(&system_listMethods)); // only used by tinyxml2
|
||||
#endif
|
||||
|
||||
CMD2_VAR_BOOL ("method.use_deprecated", true);
|
||||
CMD2_VAR_VALUE ("method.use_intermediate", 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user