* Proper fault handling for bad SCGI requests.

* Cleaned up duplicate code in 'xmlrpc.cc'.

* Cleaned up 'parse_commands.h'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@966 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-08-27 23:00:48 +00:00
parent 02b790c0bf
commit 32b74ffc48
19 changed files with 161 additions and 191 deletions
+8 -8
View File
@@ -102,21 +102,21 @@ apply_d_change_link(int changeType, core::Download* download, const torrent::Obj
std::string link;
if (type == "base_path") {
target = rpc::call_command_d_string("d.get_base_path", download);
link = rak::path_expand(prefix + rpc::call_command_d_string("d.get_base_path", download) + postfix);
target = rpc::call_command_string("d.get_base_path", rpc::make_target(download));
link = rak::path_expand(prefix + rpc::call_command_string("d.get_base_path", rpc::make_target(download)) + postfix);
} else if (type == "base_filename") {
target = rpc::call_command_d_string("d.get_base_path", download);
link = rak::path_expand(prefix + rpc::call_command_d_string("d.get_base_filename", download) + postfix);
target = rpc::call_command_string("d.get_base_path", rpc::make_target(download));
link = rak::path_expand(prefix + rpc::call_command_string("d.get_base_filename", rpc::make_target(download)) + postfix);
} else if (type == "tied") {
link = rak::path_expand(rpc::call_command_d_string("d.get_tied_to_file", download));
link = rak::path_expand(rpc::call_command_string("d.get_tied_to_file", rpc::make_target(download)));
if (link.empty())
return torrent::Object();
link = rak::path_expand(prefix + link + postfix);
target = rpc::call_command_d_string("d.get_base_path", download);
target = rpc::call_command_string("d.get_base_path", rpc::make_target(download));
} else {
throw torrent::input_error("Unknown type argument.");
@@ -150,7 +150,7 @@ apply_d_change_link(int changeType, core::Download* download, const torrent::Obj
void
apply_d_delete_tied(core::Download* download) {
const std::string& tie = rpc::call_command_d_string("d.get_tied_to_file", download);
const std::string& tie = rpc::call_command_string("d.get_tied_to_file", rpc::make_target(download));
if (tie.empty())
return;
@@ -158,7 +158,7 @@ apply_d_delete_tied(core::Download* download) {
if (::unlink(rak::path_expand(tie).c_str()) == -1)
control->core()->push_log_std("Could not unlink tied file: " + std::string(rak::error_number::current().c_str()));
rpc::call_command_d("d.set_tied_to_file", download, std::string());
rpc::call_command("d.set_tied_to_file", std::string(), rpc::make_target(download));
}
void