From 03604bb367dda5e002442c6b037c849a166297a2 Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Thu, 1 Nov 2018 19:34:18 +0300 Subject: [PATCH] SessionProxy: bugfix GitOrigin-RevId: b2cdc985d4465cdd19f85d024a5de9d8e882e8f0 --- td/telegram/net/SessionProxy.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/td/telegram/net/SessionProxy.cpp b/td/telegram/net/SessionProxy.cpp index 86b9f07d..02dc016e 100644 --- a/td/telegram/net/SessionProxy.cpp +++ b/td/telegram/net/SessionProxy.cpp @@ -154,14 +154,16 @@ void SessionProxy::open_session(bool force) { if (!session_.empty()) { return; } - if (auth_state_ == AuthState::Empty && need_destroy_) { - return; - } - if (auth_state_ != AuthState::OK && need_wait_for_key_) { - return; - } - if (!is_main_ && pending_queries_.empty() && !need_destroy_) { - return; + if (!force) { + if (auth_state_ == AuthState::Empty && need_destroy_) { + return; + } + if (auth_state_ != AuthState::OK && need_wait_for_key_) { + return; + } + if (!is_main_ && pending_queries_.empty() && !need_destroy_) { + return; + } } CHECK(session_.empty());