mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Fix possible crash in DomainResolver.
App::CallDelayed() could be queued twice for a single key, if before the delayed call we cleared entry in _attempts and created it again.
This commit is contained in:
@@ -91,6 +91,11 @@ private:
|
||||
QStringList ips;
|
||||
crl::time expireAt = 0;
|
||||
|
||||
};
|
||||
struct Attempts {
|
||||
std::vector<QString> hosts;
|
||||
base::has_weak_ptr guard;
|
||||
|
||||
};
|
||||
|
||||
void resolve(const AttemptKey &key);
|
||||
@@ -110,7 +115,7 @@ private:
|
||||
crl::time expireAt)> _callback;
|
||||
|
||||
QNetworkAccessManager _manager;
|
||||
std::map<AttemptKey, std::vector<QString>> _attempts;
|
||||
std::map<AttemptKey, Attempts> _attempts;
|
||||
std::map<AttemptKey, std::vector<ServiceWebRequest>> _requests;
|
||||
std::map<AttemptKey, CacheEntry> _cache;
|
||||
crl::time _lastTimestamp = 0;
|
||||
|
Reference in New Issue
Block a user