@@ -591,7 +591,7 @@ nsresult nsHostResolver::ResolveHost(const nsACString& aHost,
591591 } else if (!rec->mResolving ) {
592592 result =
593593 FromUnspecEntry (rec, host, aTrrServer, originSuffix, type, flags, af,
594- aOriginAttributes.IsPrivateBrowsing (), status, lock );
594+ aOriginAttributes.IsPrivateBrowsing (), status);
595595 // If this is a by-type request or if no valid record was found
596596 // in the cache or this is an AF_UNSPEC request, then start a
597597 // new lookup.
@@ -675,14 +675,12 @@ already_AddRefed<nsHostRecord> nsHostResolver::FromCache(
675675 // but start a new lookup in the background.
676676 //
677677 // Also records telemetry for type of cache hit (HIT/NEGATIVE_HIT/RENEWAL).
678- bool refresh = ConditionallyRefreshRecord (aRec, aHost, aLock);
678+ ConditionallyRefreshRecord (aRec, aHost, aLock);
679679
680680 if (aRec->negative ) {
681681 LOG ((" Negative cache entry for host [%s].\n " ,
682682 nsPromiseFlatCString (aHost).get ()));
683683 aStatus = NS_ERROR_UNKNOWN_HOST;
684- } else if (StaticPrefs::network_dns_mru_to_tail () && !refresh) {
685- mQueue .MoveToEvictionQueueTail (aRec, aLock);
686684 }
687685
688686 return result.forget ();
@@ -709,8 +707,7 @@ already_AddRefed<nsHostRecord> nsHostResolver::FromIPLiteral(
709707already_AddRefed<nsHostRecord> nsHostResolver::FromUnspecEntry (
710708 nsHostRecord* aRec, const nsACString& aHost, const nsACString& aTrrServer,
711709 const nsACString& aOriginSuffix, uint16_t aType,
712- nsIDNSService::DNSFlags aFlags, uint16_t af, bool aPb, nsresult& aStatus,
713- const MutexAutoLock& aLock) {
710+ nsIDNSService::DNSFlags aFlags, uint16_t af, bool aPb, nsresult& aStatus) {
714711 RefPtr<nsHostRecord> result = nullptr ;
715712 // If this is an IPV4 or IPV6 specific request, check if there is
716713 // an AF_UNSPEC entry we can use. Otherwise, hit the resolver...
@@ -776,10 +773,7 @@ already_AddRefed<nsHostRecord> nsHostResolver::FromUnspecEntry(
776773 if (aRec->negative ) {
777774 aStatus = NS_ERROR_UNKNOWN_HOST;
778775 }
779- bool refresh = ConditionallyRefreshRecord (aRec, aHost, lock);
780- if (!refresh) {
781- AddToEvictionQ (result, aLock);
782- }
776+ ConditionallyRefreshRecord (aRec, aHost, lock);
783777 } else if (af == PR_AF_INET6) {
784778 // For AF_INET6, a new lookup means another AF_UNSPEC
785779 // lookup. We have already iterated through the
@@ -1189,15 +1183,14 @@ nsresult nsHostResolver::NameLookup(nsHostRecord* rec,
11891183 return rv;
11901184}
11911185
1192- bool nsHostResolver::ConditionallyRefreshRecord (nsHostRecord* rec,
1193- const nsACString& host,
1194- const MutexAutoLock& aLock) {
1186+ nsresult nsHostResolver::ConditionallyRefreshRecord (
1187+ nsHostRecord* rec, const nsACString& host, const MutexAutoLock& aLock) {
11951188 if ((rec->CheckExpiration (TimeStamp::NowLoRes ()) == nsHostRecord::EXP_GRACE ||
11961189 rec->negative ) &&
11971190 !rec->mResolving && rec->RefreshForNegativeResponse ()) {
11981191 LOG ((" Using %s cache entry for host [%s] but starting async renewal." ,
11991192 rec->negative ? " negative" : " positive" , host.BeginReading ()));
1200- nsresult rv = NameLookup (rec, aLock);
1193+ NameLookup (rec, aLock);
12011194
12021195 if (rec->IsAddrRecord ()) {
12031196 if (!rec->negative ) {
@@ -1206,8 +1199,6 @@ bool nsHostResolver::ConditionallyRefreshRecord(nsHostRecord* rec,
12061199 glean::dns::lookup_method.AccumulateSingleSample (METHOD_NEGATIVE_HIT);
12071200 }
12081201 }
1209-
1210- return NS_SUCCEEDED(rv);
12111202 } else if (rec->IsAddrRecord ()) {
12121203 // it could be that the record is negative, but we haven't entered the above
12131204 // if condition due to the second expression being false. In that case we
@@ -1219,7 +1210,7 @@ bool nsHostResolver::ConditionallyRefreshRecord(nsHostRecord* rec,
12191210 }
12201211 }
12211212
1222- return false ;
1213+ return NS_OK ;
12231214}
12241215
12251216bool nsHostResolver::GetHostToLookup (nsHostRecord** result) {
0 commit comments