mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibDNS: Fix check for cache entries that can be removed
Co-authored-by: Ali Mohammad Pur <ali.mpfard@gmail.com>
This commit is contained in:
parent
26825b5865
commit
4904326244
|
|
@ -98,7 +98,7 @@ public:
|
|||
void set_id(u16 id) { m_id = id; }
|
||||
u16 id() { return m_id; }
|
||||
|
||||
bool is_valid() const { return m_valid && m_request_done; }
|
||||
bool can_be_removed() const { return !m_valid && m_request_done; }
|
||||
Messages::DomainName const& name() const { return m_name; }
|
||||
|
||||
private:
|
||||
|
|
@ -518,7 +518,7 @@ private:
|
|||
HashTable<ByteString> to_remove;
|
||||
for (auto& entry : cache) {
|
||||
entry.value->check_expiration();
|
||||
if (!entry.value->is_valid())
|
||||
if (entry.value->can_be_removed())
|
||||
to_remove.set(entry.key);
|
||||
}
|
||||
for (auto const& key : to_remove)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user