mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 14:42:30 +00:00
* 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:
@@ -292,8 +292,8 @@ DownloadList::receive_exit_input(Input type) {
|
||||
if (current_view()->focus() == current_view()->end_visible())
|
||||
throw torrent::input_error("No download in focus to change root directory.");
|
||||
|
||||
rpc::call_command_d("d.set_directory", *current_view()->focus(), rak::trim(input->str()));
|
||||
control->core()->push_log_std("New root directory \"" + rpc::call_command_d_string("d.get_directory", *current_view()->focus()) + "\" for torrent.");
|
||||
rpc::call_command("d.set_directory", rak::trim(input->str()), rpc::make_target(*current_view()->focus()));
|
||||
control->core()->push_log_std("New root directory \"" + rpc::call_command_string("d.get_directory", rpc::make_target(*current_view()->focus())) + "\" for torrent.");
|
||||
break;
|
||||
|
||||
case INPUT_COMMAND:
|
||||
|
||||
@@ -152,7 +152,7 @@ ElementDownloadList::receive_stop_download() {
|
||||
if (m_view->focus() == m_view->end_visible())
|
||||
return;
|
||||
|
||||
if (rpc::call_command_d_value("d.get_state", *m_view->focus()) == 1)
|
||||
if (rpc::call_command_value("d.get_state", rpc::make_target(*m_view->focus())) == 1)
|
||||
control->core()->download_list()->stop_normal(*m_view->focus());
|
||||
else
|
||||
control->core()->download_list()->erase_ptr(*m_view->focus());
|
||||
@@ -167,7 +167,7 @@ ElementDownloadList::receive_close_download() {
|
||||
|
||||
core::Download* download = *m_view->focus();
|
||||
|
||||
rpc::call_command_d("d.set_ignore_commands", download, (int64_t)1);
|
||||
rpc::call_command("d.set_ignore_commands", (int64_t)1, rpc::make_target(download));
|
||||
|
||||
control->core()->download_list()->stop_normal(download);
|
||||
control->core()->download_list()->close(download);
|
||||
@@ -206,11 +206,11 @@ ElementDownloadList::receive_ignore_ratio() {
|
||||
if (m_view->focus() == m_view->end_visible())
|
||||
return;
|
||||
|
||||
if (rpc::call_command_d_value("d.get_ignore_commands", *m_view->focus()) != 0) {
|
||||
rpc::call_command_d_set_value("d.set_ignore_commands", *m_view->focus(), (int64_t)0);
|
||||
if (rpc::call_command_value("d.get_ignore_commands", rpc::make_target(*m_view->focus())) != 0) {
|
||||
rpc::call_command_set_value("d.set_ignore_commands", (int64_t)0, rpc::make_target(*m_view->focus()));
|
||||
control->core()->push_log("Torrent set to heed commands.");
|
||||
} else {
|
||||
rpc::call_command_d_set_value("d.set_ignore_commands", *m_view->focus(), (int64_t)1);
|
||||
rpc::call_command_set_value("d.set_ignore_commands", (int64_t)1, rpc::make_target(*m_view->focus()));
|
||||
control->core()->push_log("Torrent set to ignore commands.");
|
||||
}
|
||||
}
|
||||
@@ -220,10 +220,10 @@ ElementDownloadList::receive_clear_tied() {
|
||||
if (m_view->focus() == m_view->end_visible())
|
||||
return;
|
||||
|
||||
const std::string& tiedFile = rpc::call_command_d_string("d.get_tied_to_file", *m_view->focus());
|
||||
const std::string& tiedFile = rpc::call_command_string("d.get_tied_to_file", rpc::make_target(*m_view->focus()));
|
||||
|
||||
if (!tiedFile.empty()) {
|
||||
rpc::call_command_d_void("d.delete_tied", *m_view->focus());
|
||||
rpc::call_command_void("d.delete_tied", rpc::make_target(*m_view->focus()));
|
||||
|
||||
control->core()->push_log("Cleared tied to file association for the selected download.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user