* 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
+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);
}