mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix "Limit special config request types."
This commit is contained in:
parent
f9ca7f4505
commit
704f64a0c9
1 changed files with 1 additions and 10 deletions
|
@ -199,16 +199,7 @@ SpecialConfigRequest::SpecialConfigRequest(
|
||||||
|
|
||||||
_manager.setProxy(QNetworkProxy::NoProxy);
|
_manager.setProxy(QNetworkProxy::NoProxy);
|
||||||
|
|
||||||
auto domains = DnsDomains();
|
|
||||||
const auto domainsCount = domains.size();
|
|
||||||
|
|
||||||
std::random_device rd;
|
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) {
|
const auto shuffle = [&](int from, int till) {
|
||||||
Expects(till > from);
|
Expects(till > from);
|
||||||
|
|
||||||
|
@ -231,7 +222,7 @@ SpecialConfigRequest::SpecialConfigRequest(
|
||||||
|
|
||||||
shuffle(0, 2);
|
shuffle(0, 2);
|
||||||
if (!_timeDoneCallback) {
|
if (!_timeDoneCallback) {
|
||||||
shuffle(_attempts.size() - (domainsCount + 1), _attempts.size());
|
shuffle(_attempts.size() - (int(DnsDomains().size()) + 1), _attempts.size());
|
||||||
}
|
}
|
||||||
if (isTestMode) {
|
if (isTestMode) {
|
||||||
_attempts.erase(ranges::remove_if(_attempts, [](
|
_attempts.erase(ranges::remove_if(_attempts, [](
|
||||||
|
|
Loading…
Add table
Reference in a new issue