trying to fix bug when active temporary auth key is dropped
This commit is contained in:
parent
7eabd8ca60
commit
8ac019e589
|
@ -227,6 +227,9 @@ Session::Session(unique_ptr<Callback> callback, std::shared_ptr<AuthDataShared>
|
||||||
auth_data_.set_future_salts(shared_auth_data_->get_future_salts(), Time::now());
|
auth_data_.set_future_salts(shared_auth_data_->get_future_salts(), Time::now());
|
||||||
if (use_pfs && !tmp_auth_key.empty()) {
|
if (use_pfs && !tmp_auth_key.empty()) {
|
||||||
auth_data_.set_tmp_auth_key(tmp_auth_key);
|
auth_data_.set_tmp_auth_key(tmp_auth_key);
|
||||||
|
if (is_main_) {
|
||||||
|
registered_temp_auth_key_ = TempAuthKeyWatchdog::register_auth_key_id(auth_data_.get_tmp_auth_key().id());
|
||||||
|
}
|
||||||
auth_data_.set_future_salts(server_salts, Time::now());
|
auth_data_.set_future_salts(server_salts, Time::now());
|
||||||
}
|
}
|
||||||
uint64 session_id = 0;
|
uint64 session_id = 0;
|
||||||
|
|
|
@ -63,6 +63,7 @@ class TempAuthKeyWatchdog final : public NetQueryCallback {
|
||||||
bool run_sync_ = false;
|
bool run_sync_ = false;
|
||||||
|
|
||||||
void register_auth_key_id_impl(int64 id) {
|
void register_auth_key_id_impl(int64 id) {
|
||||||
|
LOG(INFO) << "Register key " << id;
|
||||||
if (!++id_count_[id]) {
|
if (!++id_count_[id]) {
|
||||||
id_count_.erase(id);
|
id_count_.erase(id);
|
||||||
}
|
}
|
||||||
|
@ -70,6 +71,7 @@ class TempAuthKeyWatchdog final : public NetQueryCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
void unregister_auth_key_id_impl(int64 id) {
|
void unregister_auth_key_id_impl(int64 id) {
|
||||||
|
LOG(INFO) << "Unregister key " << id;
|
||||||
if (!--id_count_[id]) {
|
if (!--id_count_[id]) {
|
||||||
id_count_.erase(id);
|
id_count_.erase(id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user