[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit b14cced3e448b5d5eec98675909a42a156e478cb
Author: Nicholas Hurley <hurley@xxxxxxxxxxxxxx>
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);
+                        }
                     }
                 }
                 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits