* Added 'rpc/fixed_key.h' header.

* Replaced Command with command_base.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1168 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2010-04-30 04:36:02 +00:00
parent 7dad6d34f3
commit 8b03988612
15 changed files with 307 additions and 248 deletions
+12 -12
View File
@@ -230,39 +230,39 @@ parse_command_name(const char* first, const char* last, std::string* dest) {
// Temp until it can be moved somewhere better...
const torrent::Object
command_function_call(const torrent::raw_string& cmd, target_type target, const torrent::Object& args) {
rpc::Command::stack_type stack;
rpc::command_base::stack_type stack;
torrent::Object* last_stack;
if (args.is_list())
last_stack = rpc::Command::push_stack(args.as_list(), &stack);
last_stack = rpc::command_base::push_stack(args.as_list(), &stack);
else if (args.type() != torrent::Object::TYPE_NONE)
last_stack = rpc::Command::push_stack(&args, &args + 1, &stack);
last_stack = rpc::command_base::push_stack(&args, &args + 1, &stack);
else
last_stack = rpc::Command::push_stack(NULL, NULL, &stack);
last_stack = rpc::command_base::push_stack(NULL, NULL, &stack);
try {
torrent::Object result = parse_command_multiple(target, cmd.begin(), cmd.end());
rpc::Command::pop_stack(&stack, last_stack);
rpc::command_base::pop_stack(&stack, last_stack);
return result;
} catch (torrent::bencode_error& e) {
rpc::Command::pop_stack(&stack, last_stack);
rpc::command_base::pop_stack(&stack, last_stack);
throw e;
}
}
const torrent::Object
command_function_multi_call(const torrent::Object::map_type& cmd, target_type target, const torrent::Object& args) {
rpc::Command::stack_type stack;
rpc::command_base::stack_type stack;
torrent::Object* last_stack;
if (args.is_list())
last_stack = rpc::Command::push_stack(args.as_list(), &stack);
last_stack = rpc::command_base::push_stack(args.as_list(), &stack);
else if (args.type() != torrent::Object::TYPE_NONE)
last_stack = rpc::Command::push_stack(&args, &args + 1, &stack);
last_stack = rpc::command_base::push_stack(&args, &args + 1, &stack);
else
last_stack = rpc::Command::push_stack(NULL, NULL, &stack);
last_stack = rpc::command_base::push_stack(NULL, NULL, &stack);
try {
for (torrent::Object::map_const_iterator itr = cmd.begin(), last = cmd.end(); itr != last; itr++) {
@@ -271,11 +271,11 @@ command_function_multi_call(const torrent::Object::map_type& cmd, target_type ta
}
} catch (torrent::bencode_error& e) {
rpc::Command::pop_stack(&stack, last_stack);
rpc::command_base::pop_stack(&stack, last_stack);
throw e;
}
rpc::Command::pop_stack(&stack, last_stack);
rpc::command_base::pop_stack(&stack, last_stack);
return torrent::Object();
}