From 89b02f275e0d17ec356d882ca83c0fd2d098276a Mon Sep 17 00:00:00 2001 From: rakshasa Date: Fri, 23 Sep 2016 08:22:24 +0900 Subject: [PATCH] Added "system.shutdown", "system.shutdown.normal" and "system.shutdown.quick". --- src/command_local.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/command_local.cc b/src/command_local.cc index 741b3000..553368af 100644 --- a/src/command_local.cc +++ b/src/command_local.cc @@ -230,10 +230,10 @@ cmd_file_append(const torrent::Object::list_type& args) { void initialize_command_local() { - torrent::ChunkManager* chunkManager = torrent::chunk_manager(); - torrent::FileManager* fileManager = torrent::file_manager(); core::DownloadList* dList = control->core()->download_list(); core::DownloadStore* dStore = control->core()->download_store(); + torrent::ChunkManager* chunkManager = torrent::chunk_manager(); + torrent::FileManager* fileManager = torrent::file_manager(); CMD2_ANY ("system.hostname", std::bind(&system_hostname)); CMD2_ANY ("system.pid", std::bind(&getpid)); @@ -268,6 +268,10 @@ initialize_command_local() { CMD2_VAR_BOOL ("system.daemon", false); + CMD2_ANY_V ("system.shutdown.normal", std::bind(&Control::receive_normal_shutdown, control)); + CMD2_ANY_V ("system.shutdown.quick", std::bind(&Control::receive_quick_shutdown, control)); + CMD2_REDIRECT_GENERIC_NO_EXPORT("system.shutdown", "system.shutdown.normal"); + CMD2_ANY ("system.cwd", std::bind(&system_get_cwd)); CMD2_ANY_STRING ("system.cwd.set", std::bind(&system_set_cwd, std::placeholders::_2));