diff --git a/netwerk/dns/nsHostRecord.cpp b/netwerk/dns/nsHostRecord.cpp index 159abb6e548b..114d62dadd83 100644 --- a/netwerk/dns/nsHostRecord.cpp +++ b/netwerk/dns/nsHostRecord.cpp @@ -39,6 +39,15 @@ nsHostKey::nsHostKey(const nsACString& aHost, const nsACString& aTrrServer, pb(aPb), originSuffix(aOriginsuffix) {} +nsHostKey::nsHostKey(const nsHostKey& other) + : host(other.host), + mTrrServer(other.mTrrServer), + type(other.type), + flags(other.flags), + af(other.af), + pb(other.pb), + originSuffix(other.originSuffix) {} + bool nsHostKey::operator==(const nsHostKey& other) const { return host == other.host && mTrrServer == other.mTrrServer && type == other.type && diff --git a/netwerk/dns/nsHostRecord.h b/netwerk/dns/nsHostRecord.h index c3a73907ae1e..5b193fbdab18 100644 --- a/netwerk/dns/nsHostRecord.h +++ b/netwerk/dns/nsHostRecord.h @@ -79,13 +79,15 @@ struct nsHostKey { const nsCString host; const nsCString mTrrServer; uint16_t type = 0; - nsIDNSService::DNSFlags flags = nsIDNSService::RESOLVE_DEFAULT_FLAGS; + mozilla::Atomic flags{ + nsIDNSService::RESOLVE_DEFAULT_FLAGS}; uint16_t af = 0; bool pb = false; const nsCString originSuffix; explicit nsHostKey(const nsACString& host, const nsACString& aTrrServer, uint16_t type, nsIDNSService::DNSFlags flags, uint16_t af, bool pb, const nsACString& originSuffix); + explicit nsHostKey(const nsHostKey& other); bool operator==(const nsHostKey& other) const; size_t SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const; PLDHashNumber Hash() const; diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index 4d0e928e860a..6ad32ab0defd 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -1185,7 +1185,8 @@ nsresult nsHostResolver::NameLookup(nsHostRecord* rec, } LOG(("NameLookup: %s effectiveTRRmode: %d flags: %X", rec->host.get(), - static_cast(rec->mEffectiveTRRMode), rec->flags)); + static_cast(rec->mEffectiveTRRMode), + static_cast(rec->flags))); if (rec->flags & nsIDNSService::RESOLVE_DISABLE_TRR) { rec->RecordReason(TRRSkippedReason::TRR_DISABLED_FLAG); @@ -2032,8 +2033,9 @@ void nsHostResolver::GetDNSCacheEntries(nsTArray* args) { } info.originAttributesSuffix = recordEntry.GetKey().originSuffix; - info.flags = nsPrintfCString("%u|0x%x|%u|%d|%s", rec->type, rec->flags, - rec->af, rec->pb, rec->mTrrServer.get()); + info.flags = nsPrintfCString("%u|0x%x|%u|%d|%s", rec->type, + static_cast(rec->flags), rec->af, + rec->pb, rec->mTrrServer.get()); args->AppendElement(std::move(info)); }