From 5abcf52e553a99fbdb95ac2a33d5c6db7238cc0a Mon Sep 17 00:00:00 2001 From: kannibalox Date: Mon, 11 Nov 2024 10:48:23 -0500 Subject: [PATCH] Remove unused flag_delete_key --- src/command_dynamic.cc | 6 +++--- src/command_helpers.h | 4 ++-- src/rpc/command_map.cc | 2 +- src/rpc/command_map.h | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/command_dynamic.cc b/src/command_dynamic.cc index 560b673e..de54309d 100644 --- a/src/command_dynamic.cc +++ b/src/command_dynamic.cc @@ -172,7 +172,7 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) { } // We must initialize this varriable to prevent a critical memory leak - int cmd_flags = rpc::CommandMap::flag_delete_key; + int cmd_flags = 0; if (!(flags & rpc::object_storage::flag_static)) cmd_flags |= rpc::CommandMap::flag_modifiable; @@ -287,7 +287,7 @@ system_method_insert(const torrent::Object::list_type& args) { if (rawKey.empty() || rpc::commands.has(rawKey)) throw torrent::input_error("Invalid key."); - int flags = rpc::CommandMap::flag_delete_key | rpc::CommandMap::flag_modifiable | rpc::CommandMap::flag_public_xmlrpc; + int flags = rpc::CommandMap::flag_modifiable | rpc::CommandMap::flag_public_xmlrpc; int new_flags = rpc::parse_option_flags(itrArgs->as_string(), std::bind(&object_storage_parse_flag, std::placeholders::_1)); if ((new_flags & rpc::object_storage::flag_private)) @@ -346,7 +346,7 @@ system_method_redirect(const torrent::Object::list_type& args) { std::string dest_key = torrent::object_create_string(args.back()); rpc::commands.create_redirect(new_key, dest_key, - rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_delete_key | rpc::CommandMap::flag_modifiable); + rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_modifiable); return torrent::Object(); } diff --git a/src/command_helpers.h b/src/command_helpers.h index 0f43f3e0..bba6aab7 100644 --- a/src/command_helpers.h +++ b/src/command_helpers.h @@ -149,11 +149,11 @@ void initialize_commands(); #define CMD2_REDIRECT_GENERIC_STR(from_key, to_key) \ rpc::commands.create_redirect(from_key, to_key, \ - rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_no_target | rpc::CommandMap::flag_delete_key); + rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_no_target); #define CMD2_REDIRECT_GENERIC_STR_NO_EXPORT(from_key, to_key) \ rpc::commands.create_redirect(from_key, to_key, \ - rpc::CommandMap::flag_no_target | rpc::CommandMap::flag_delete_key); + rpc::CommandMap::flag_no_target); // // Conversion of return types: diff --git a/src/rpc/command_map.cc b/src/rpc/command_map.cc index 805be565..7dcef244 100644 --- a/src/rpc/command_map.cc +++ b/src/rpc/command_map.cc @@ -102,7 +102,7 @@ CommandMap::create_redirect(const key_type& key_new, const key_type& key_dest, i dest_itr->second.m_flags |= flag_has_redirects; - flags |= dest_itr->second.m_flags & ~(flag_delete_key | flag_has_redirects | flag_public_xmlrpc); + flags |= dest_itr->second.m_flags & ~(flag_has_redirects | flag_public_xmlrpc); // TODO: This is not honoring the public_xmlrpc flags!!! if (rpc::xmlrpc.is_valid() && (flags & flag_public_xmlrpc)) diff --git a/src/rpc/command_map.h b/src/rpc/command_map.h index 561ab01a..27573e60 100644 --- a/src/rpc/command_map.h +++ b/src/rpc/command_map.h @@ -86,7 +86,6 @@ public: using base_type::find; static const int flag_dont_delete = 0x1; - static const int flag_delete_key = 0x2; static const int flag_public_xmlrpc = 0x4; static const int flag_modifiable = 0x10; static const int flag_is_redirect = 0x20;