mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-04 21:37:45 +00:00
Fix "Limit special config request types."
This commit is contained in:
parent
f9ca7f4505
commit
704f64a0c9
@ -199,16 +199,7 @@ SpecialConfigRequest::SpecialConfigRequest(
|
||||
|
||||
_manager.setProxy(QNetworkProxy::NoProxy);
|
||||
|
||||
auto domains = DnsDomains();
|
||||
const auto domainsCount = domains.size();
|
||||
|
||||
std::random_device rd;
|
||||
ranges::shuffle(domains, std::mt19937(rd()));
|
||||
const auto takeDomain = [&] {
|
||||
const auto result = domains.back();
|
||||
domains.pop_back();
|
||||
return result;
|
||||
};
|
||||
const auto shuffle = [&](int from, int till) {
|
||||
Expects(till > from);
|
||||
|
||||
@ -231,7 +222,7 @@ SpecialConfigRequest::SpecialConfigRequest(
|
||||
|
||||
shuffle(0, 2);
|
||||
if (!_timeDoneCallback) {
|
||||
shuffle(_attempts.size() - (domainsCount + 1), _attempts.size());
|
||||
shuffle(_attempts.size() - (int(DnsDomains().size()) + 1), _attempts.size());
|
||||
}
|
||||
if (isTestMode) {
|
||||
_attempts.erase(ranges::remove_if(_attempts, [](
|
||||
|
Loading…
Reference in New Issue
Block a user