mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 15:35:51 +00:00
Create keys not simultaneously.
This commit is contained in:
@@ -183,9 +183,10 @@ DcKeyCreator::DcKeyCreator(
|
|||||||
answered();
|
answered();
|
||||||
});
|
});
|
||||||
|
|
||||||
pqSend(&_temporary, _request.temporaryExpiresIn);
|
|
||||||
if (_request.persistentNeeded) {
|
if (_request.persistentNeeded) {
|
||||||
pqSend(&_persistent, 0);
|
pqSend(&_persistent, 0);
|
||||||
|
} else {
|
||||||
|
pqSend(&_temporary, _request.temporaryExpiresIn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,13 +603,12 @@ void DcKeyCreator::failed(Error error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DcKeyCreator::done() {
|
void DcKeyCreator::done() {
|
||||||
Expects(_temporary.stage != Stage::None);
|
if (_temporary.stage == Stage::None) {
|
||||||
|
pqSend(&_temporary, _request.temporaryExpiresIn);
|
||||||
if (_persistent.stage != Stage::None && _persistent.stage != Stage::Ready) {
|
|
||||||
return;
|
|
||||||
} else if (_temporary.stage != Stage::Ready) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Assert(_temporary.stage == Stage::Ready);
|
||||||
|
Assert(_persistent.stage == Stage::Ready || _persistent.stage == Stage::None);
|
||||||
|
|
||||||
auto result = Result();
|
auto result = Result();
|
||||||
result.temporaryKey = std::make_shared<AuthKey>(
|
result.temporaryKey = std::make_shared<AuthKey>(
|
||||||
|
Reference in New Issue
Block a user