* Handle XMLRPC commands with no arguments as if the target is empty.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1158 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2010-04-04 08:13:44 +00:00
parent 4c6c943669
commit 8da449f666
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -327,9 +327,9 @@ main(int argc, char** argv) {
#define CMD2_REDIRECT_GENERIC(from_key, to_key) \
rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_no_target);
CMD2_REDIRECT ("system.method.insert", "method.insert");
CMD2_REDIRECT ("system.method.set", "method.set");
CMD2_REDIRECT ("system.method.set_key", "method.set_key");
CMD2_REDIRECT_GENERIC("system.method.insert", "method.insert");
CMD2_REDIRECT_GENERIC("system.method.set", "method.set");
CMD2_REDIRECT_GENERIC("system.method.set_key", "method.set_key");
CMD2_REDIRECT ("get_handshake_log", "log.handshake");
CMD2_REDIRECT ("set_handshake_log", "log.handshake.set");
+2 -2
View File
@@ -303,7 +303,7 @@ xmlrpc_to_object(xmlrpc_env* env, xmlrpc_value* value, int callType, rpc::target
if (env->fault_occurred)
throw xmlrpc_error(env);
if (callType != XmlRpc::call_generic) {
if (callType != XmlRpc::call_generic && last != 0) {
if (last < 1)
throw xmlrpc_error(XMLRPC_TYPE_ERROR, "Too few arguments.");
@@ -326,7 +326,7 @@ xmlrpc_to_object(xmlrpc_env* env, xmlrpc_value* value, int callType, rpc::target
// parameter as the index to support old-style calls.
if (current == last)
throw xmlrpc_error(XMLRPC_TYPE_ERROR, "Too few arguments.");
throw xmlrpc_error(XMLRPC_TYPE_ERROR, "Too few arguments, missing index.");
*target = xmlrpc_to_index_type(xmlrpc_list_entry_to_value(env, value, current++), callType, (core::Download*)target->second);
}