From 33f11f867940b5dd756d278cef0f77f5c48a73db Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Wed, 10 Jan 2024 13:12:53 +0800 Subject: [PATCH] fix: use one variable to store `TR_KEY_rpc_authentication_required` (#6514) --- libtransmission/rpc-server.cc | 2 +- libtransmission/rpc-server.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libtransmission/rpc-server.cc b/libtransmission/rpc-server.cc index f024c4c9f..ed2fc9bc3 100644 --- a/libtransmission/rpc-server.cc +++ b/libtransmission/rpc-server.cc @@ -811,7 +811,7 @@ void tr_rpc_server::set_password(std::string_view password) noexcept void tr_rpc_server::set_password_enabled(bool enabled) { - is_password_enabled_ = enabled; + authentication_required_ = enabled; tr_logAddDebug(fmt::format("setting password-enabled to '{}'", enabled)); } diff --git a/libtransmission/rpc-server.h b/libtransmission/rpc-server.h index 90d441668..62fae3fda 100644 --- a/libtransmission/rpc-server.h +++ b/libtransmission/rpc-server.h @@ -102,7 +102,7 @@ public: [[nodiscard]] constexpr auto is_password_enabled() const noexcept { - return is_password_enabled_; + return authentication_required_; } void set_password_enabled(bool enabled); @@ -163,6 +163,4 @@ public: size_t login_attempts_ = 0U; int start_retry_counter = 0; - - bool is_password_enabled_ = false; };