1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:57:47 +00:00

LookupServer: Store DNSName's in HashMap's directly

DNSName can now take care of case conversion when comparing using traits.
It still intentionally doesn't implement operator ==; you have to explicitly
decide whether you want case-sensitive or case-insensitive comparison.

This change makes caches (and /etc/hosts) case-transparent: we will now match
domains if they're the same except for the case.
This commit is contained in:
Sergey Bugaev 2021-02-14 16:33:16 +03:00 committed by Andreas Kling
parent bacbde31f3
commit e9387e43db
4 changed files with 23 additions and 7 deletions

View file

@ -43,6 +43,12 @@ public:
void randomize_case();
class Traits : public AK::Traits<DNSName> {
public:
static unsigned hash(const DNSName& name);
static bool equals(const DNSName&, const DNSName&);
};
private:
String m_name;
};