From 935161c20e1136b1daf65e25f49f254825a45be0 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 25 Dec 2019 16:57:18 +0300 Subject: [PATCH] Rename save_system_time to save_server_time. GitOrigin-RevId: 9ffc8414c74872c7807faa85071818a0993aca87 --- td/telegram/Global.cpp | 2 +- td/telegram/Global.h | 6 ++++-- td/telegram/net/ConnectionCreator.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/td/telegram/Global.cpp b/td/telegram/Global.cpp index e14be0c5..b00c480f 100644 --- a/td/telegram/Global.cpp +++ b/td/telegram/Global.cpp @@ -127,7 +127,7 @@ void Global::update_server_time_difference(double diff) { } } -void Global::save_system_time() { +void Global::save_server_time() { auto t = Time::now(); if (system_time_saved_at_.load(std::memory_order_relaxed) + 10 < t) { system_time_saved_at_ = t; diff --git a/td/telegram/Global.h b/td/telegram/Global.h index d0dbfc0b..8b428ab3 100644 --- a/td/telegram/Global.h +++ b/td/telegram/Global.h @@ -144,8 +144,8 @@ class Global : public ActorContext { } void update_server_time_difference(double diff); - void save_system_time(); - void do_save_server_time_difference(); + + void save_server_time(); double get_server_time_difference() const { return server_time_difference_.load(std::memory_order_relaxed); @@ -426,6 +426,8 @@ class Global : public ActorContext { std::unordered_map location_access_hashes_; + void do_save_server_time_difference(); + void do_close(Promise<> on_finish, bool destroy_flag); }; diff --git a/td/telegram/net/ConnectionCreator.cpp b/td/telegram/net/ConnectionCreator.cpp index 8ae9e583..db90a4fd 100644 --- a/td/telegram/net/ConnectionCreator.cpp +++ b/td/telegram/net/ConnectionCreator.cpp @@ -577,7 +577,7 @@ void ConnectionCreator::on_online(bool online_flag) { } void ConnectionCreator::on_pong(size_t hash) { - G()->save_system_time(); + G()->save_server_time(); if (active_proxy_id_ != 0) { auto now = G()->unix_time(); int32 &last_used = proxy_last_used_date_[active_proxy_id_]; @@ -1007,7 +1007,7 @@ void ConnectionCreator::client_add_connection(size_t hash, Resultsave_system_time(); + G()->save_server_time(); client_loop(clients_[hash]); }