1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 07:38:10 +00:00

LookupServer: Don't cache DNS questions

We should only cache RRs (which we represent as instances of DNSAnswer), now
which questions generated them.
This commit is contained in:
Sergey Bugaev 2021-02-14 16:20:19 +03:00 committed by Andreas Kling
parent 80f7489df0
commit 89f718c4c5
2 changed files with 29 additions and 24 deletions

View file

@ -45,17 +45,15 @@ private:
LookupServer();
void load_etc_hosts();
void put_in_cache(const DNSAnswer&);
Vector<String> lookup(const DNSName& hostname, const String& nameserver, bool& did_get_response, unsigned short record_type, ShouldRandomizeCase = ShouldRandomizeCase::Yes);
struct CachedLookup {
DNSQuestion question;
Vector<DNSAnswer> answers;
};
RefPtr<Core::LocalServer> m_local_server;
Vector<String> m_nameservers;
HashMap<String, String> m_etc_hosts;
HashMap<String, CachedLookup> m_lookup_cache;
HashMap<String, Vector<DNSAnswer>> m_lookup_cache;
};
}