[tor-commits] [tor-browser/esr24] Bug 966006. r=mcmanus a=abillings

mikeperry at torproject.org mikeperry at torproject.org
Fri Aug 29 05:26:39 UTC 2014


commit b14cced3e448b5d5eec98675909a42a156e478cb
Author: Nicholas Hurley <hurley at todesschaf.org>
Date:   Tue Apr 8 12:41:17 2014 -0700

    Bug 966006. r=mcmanus a=abillings
---
 netwerk/dns/nsHostResolver.cpp |   28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp
index ef652f9..72eec6a 100644
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -549,18 +549,22 @@ nsHostResolver::ResolveHost(const char            *host,
                 // For entries that are in the grace period with a failed connect,
                 // or all cached negative entries, use the cache but start a new lookup in
                 // the background
-                if ((((TimeStamp::NowLoRes() > he->rec->expiration) &&
-                      he->rec->mBlacklistedItems.Length()) ||
-                     he->rec->negative) && !he->rec->resolving) {
-                    LOG(("Using %s cache entry for host [%s] but starting async renewal.",
-                         he->rec->negative ? "negative" :"positive", host));
-                    IssueLookup(he->rec);
-
-                    if (!he->rec->negative) {
-                        // negative entries are constantly being refreshed, only
-                        // track positive grace period induced renewals
-                        Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2,
-                                              METHOD_RENEWAL);
+                {
+                    MutexAutoLock lock(he->rec->addr_info_lock);
+
+                    if ((((TimeStamp::NowLoRes() > he->rec->expiration) &&
+                          he->rec->mBlacklistedItems.Length()) ||
+                         he->rec->negative) && !he->rec->resolving) {
+                        LOG(("Using %s cache entry for host [%s] but starting async renewal.",
+                             he->rec->negative ? "negative" :"positive", host));
+                        IssueLookup(he->rec);
+
+                        if (!he->rec->negative) {
+                            // negative entries are constantly being refreshed, only
+                            // track positive grace period induced renewals
+                            Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2,
+                                                  METHOD_RENEWAL);
+                        }
                     }
                 }
                 





More information about the tor-commits mailing list