From b3ca84fffb5260879f74679f6fa1b70f96a35b54 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 18 May 2018 19:44:46 +0300 Subject: [PATCH] Delete unused fields. Add test. GitOrigin-RevId: 6ce7ff71d926142a7c178d56a2f489f1634322b9 --- td/telegram/ConfigManager.cpp | 7 ++----- tdnet/td/net/GetHostByNameActor.cpp | 2 ++ tdutils/test/misc.cpp | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index f17d38a2e..708b96eb3 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -243,7 +243,6 @@ ActorOwn<> get_full_config(DcId dc_id, IPAddress ip_address, Promise } double get_server_time_difference() override { return G()->get_server_time_difference(); - //return server_time_difference_; } void add_auth_key_listener(unique_ptr listener) override { if (listener->notify()) { @@ -267,8 +266,6 @@ ActorOwn<> get_full_config(DcId dc_id, IPAddress ip_address, Promise private: DcId dc_id_; std::shared_ptr public_rsa_key_ = std::make_shared(DcId::empty()); - bool has_server_time_difference_ = false; - double server_time_difference_ = 0; std::vector> auth_key_listeners_; void notify() { @@ -277,10 +274,10 @@ ActorOwn<> get_full_config(DcId dc_id, IPAddress ip_address, Promise auth_key_listeners_.erase(it, auth_key_listeners_.end()); } - string auth_key_key() { + string auth_key_key() const { return PSTRING() << "config_recovery_auth" << dc_id().get_raw_id(); } - string future_salts_key() { + string future_salts_key() const { return PSTRING() << "config_recovery_salt" << dc_id().get_raw_id(); } }; diff --git a/tdnet/td/net/GetHostByNameActor.cpp b/tdnet/td/net/GetHostByNameActor.cpp index b6cdcca0f..f2b9313f6 100644 --- a/tdnet/td/net/GetHostByNameActor.cpp +++ b/tdnet/td/net/GetHostByNameActor.cpp @@ -10,6 +10,7 @@ #include "td/utils/Time.h" namespace td { + GetHostByNameActor::GetHostByNameActor(int32 ok_timeout, int32 error_timeout) : ok_timeout_(ok_timeout), error_timeout_(error_timeout) { } @@ -45,4 +46,5 @@ Result GetHostByNameActor::load_ip(string host, int port) { return std::move(status); } } + } // namespace td diff --git a/tdutils/test/misc.cpp b/tdutils/test/misc.cpp index 408c519ac..a793331fe 100644 --- a/tdutils/test/misc.cpp +++ b/tdutils/test/misc.cpp @@ -298,6 +298,7 @@ TEST(Misc, idn_to_ascii) { test_idn_to_ascii_one("win-2k12r2-addc.阿伯测阿伯测ad.hai.com", "win-2k12r2-addc.xn--ad-tl3ca3569aba8944eca.hai.com"); test_idn_to_ascii_one("✌️.ws", "xn--7bi.ws"); test_idn_to_ascii_one("⛧", "xn--59h"); + test_idn_to_ascii_one("--рф.рф", "xn-----mmcq.xn--p1ai"); ASSERT_TRUE(idn_to_ascii("\xc0").is_error()); }