From 38efb877375fc9663ab70eafa2d197a34f61cf38 Mon Sep 17 00:00:00 2001 From: kannibalox Date: Sat, 30 Sep 2023 23:35:02 -0400 Subject: [PATCH 1/2] Ensure compability check actually checks the type for files Fixes https://github.com/rakshasa/rtorrent/issues/854 --- src/rpc/command_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/command_impl.h b/src/rpc/command_impl.h index b7ec9168c..6821c2dd0 100644 --- a/src/rpc/command_impl.h +++ b/src/rpc/command_impl.h @@ -63,7 +63,7 @@ template <> struct target_type_id { static con template <> inline bool is_target_compatible(const target_type& target) { return true; } template <> inline bool -is_target_compatible(const target_type& target) { return target.first == command_base::target_file || command_base::target_file_itr; } +is_target_compatible(const target_type& target) { return (target.first == target_type_id::value || target.first == command_base::target_file_itr); } template <> inline target_type get_target_cast(target_type target, int type) { return target; } From f4abd0a2e0498fbc3d22800e06db796b07a44914 Mon Sep 17 00:00:00 2001 From: Jari Sundell Date: Thu, 5 Dec 2024 03:25:59 +0900 Subject: [PATCH 2/2] Use proper target namespace --- src/rpc/command_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/command_impl.h b/src/rpc/command_impl.h index 6821c2dd0..8bf0a42aa 100644 --- a/src/rpc/command_impl.h +++ b/src/rpc/command_impl.h @@ -63,7 +63,7 @@ template <> struct target_type_id { static con template <> inline bool is_target_compatible(const target_type& target) { return true; } template <> inline bool -is_target_compatible(const target_type& target) { return (target.first == target_type_id::value || target.first == command_base::target_file_itr); } +is_target_compatible(const target_type& target) { return (target.first == command_base::target_file || target.first == command_base::target_file_itr); } template <> inline target_type get_target_cast(target_type target, int type) { return target; }