Fix connection re-init in case of CONNECTION_NOT_INITED.
This commit is contained in:
parent
13ad39dfc2
commit
cad6faa790
|
@ -1537,6 +1537,7 @@ bool Instance::Private::onErrorDefault(
|
||||||
|
|
||||||
const auto session = getSession(qAbs(dcWithShift));
|
const auto session = getSession(qAbs(dcWithShift));
|
||||||
request->needsLayer = true;
|
request->needsLayer = true;
|
||||||
|
session->setConnectionNotInited();
|
||||||
session->sendPrepared(request);
|
session->sendPrepared(request);
|
||||||
return true;
|
return true;
|
||||||
} else if (type == u"CONNECTION_LANG_CODE_INVALID"_q) {
|
} else if (type == u"CONNECTION_LANG_CODE_INVALID"_q) {
|
||||||
|
|
|
@ -257,10 +257,14 @@ void Session::refreshOptions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::reInitConnection() {
|
void Session::reInitConnection() {
|
||||||
_dc->setConnectionInited(false);
|
setConnectionNotInited();
|
||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Session::setConnectionNotInited() {
|
||||||
|
_dc->setConnectionInited(false);
|
||||||
|
}
|
||||||
|
|
||||||
void Session::stop() {
|
void Session::stop() {
|
||||||
if (_killed) {
|
if (_killed) {
|
||||||
DEBUG_LOG(("Session Error: can't stop a killed session"));
|
DEBUG_LOG(("Session Error: can't stop a killed session"));
|
||||||
|
|
|
@ -142,6 +142,7 @@ public:
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void reInitConnection();
|
void reInitConnection();
|
||||||
|
void setConnectionNotInited();
|
||||||
|
|
||||||
void restart();
|
void restart();
|
||||||
void refreshOptions();
|
void refreshOptions();
|
||||||
|
|
Loading…
Reference in New Issue