Граф коммитов

80 Коммитов

Автор SHA1 Сообщение Дата
Daniel Stenberg 20d398643b bug 1441256 - bypass cache when retrying connection without TRR r=mcmanus,valentin
Otherwise it will just load back the same (problematic) addresses from the
cache again the second time. This introduces a new resolver bit
(REFRESH_CACHE) that also invalidates the existing cache entry while doing the
new resolve.

MozReview-Commit-ID: 5Bc2KiAGYYA

--HG--
extra : rebase_source : ae368c88a5db27f0980b9928439d27588bc84815
2018-03-06 14:50:21 +01:00
Daniel Stenberg 14fc881f71 bug 1438947 - mutex nsHostRecord::mTrrA[AAA] accesses r=valentin
... and remove Cancel() from nsHostRecord::RemoveOrRefresh since we
don't need to cancel TRR resolves due to network changes.

MozReview-Commit-ID: Akuhpzgg4N5
2018-02-22 04:22:00 +02:00
Valentin Gosu 98e8686b20 Bug 1439538 - Convert nsHostResolver::m{High,Medium,Low,Eviction}Q to LinkedList<RefPtr<nsHostRecord>> r=bagder
MozReview-Commit-ID: CDMadOtmDHQ

--HG--
extra : rebase_source : aa366237886c7d07cb3d83a15c50a54c08606848
2018-02-20 17:41:50 +01:00
Daniel Stenberg e5d3226694 bug 1434852 - introducing TRR (DOH); r=mcmanus,valentin
Provides an optional resolver mechanism for Firefox that allows running
together with or instead of the native resolver.

TRR offers resolving of host names using a dedicated DNS-over-HTTPS server
(HTTPS is required, HTTP/2 is preferable).

DNS-over-HTTPS (DOH) allows DNS resolves with enhanced privacy, secure
transfers and improved performance.

To keep the failure rate at a minimum, the TRR system manages a dynamic
persistent blacklist for host names that can't be resolved with DOH but works
with the native resolver. Blacklisted entries will not be retried over DOH for
a couple of days. "localhost" and names in the ".local" TLD will not be
resolved via DOH.

TRR is preffed OFF by default and you need to set a URI for an available DOH
server to be able to use it. Since the URI for DOH is set with a name itself,
it may have to use the native resolver for bootstrapping. (Optionally, the
user can set the IP address of the DOH server in a pref to avoid the required
initial native resolve.)

When TRR starts up, it will first verify that it works by checking a
"confirmation" domain name. This confirmation domain is a pref by default set
to "example.com". TRR will also by default await the captive-portal detection
to raise its green flag before getting activated.

All prefs for TRR are under the "network.trr" hierarchy.

The DNS-over-HTTPS spec: https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-03

MozReview-Commit-ID: GuuU6vjTjlm

--HG--
extra : rebase_source : 53fcca757334090ac05fec540ef29d109d5ceed3
2018-02-01 10:20:49 +01:00
Valentin Gosu c4e59fe243 Bug 1427373 - Convert nsHostResolver.mDB from PLDHashTable to nsRefPtrHashtable r=mayhemer
* Converts PLDHashTable mDB to nsRefPtrHashtable<nsGenericHashKey<nsHostKey>, nsHostRecord> mRecordDB
* Removes nsHostDBEnt and associated PLDHashTableOps

This patch makes the code a lot easier to understand, by simplifying the
ownership model. Now the hashtable holds RefPtr<nsHostRecord>, so it's
easier to follow the lifetime of each record.

MozReview-Commit-ID: IMavN8YSPSn

--HG--
extra : rebase_source : 3ff3135e2d9610577f15aaf307a62eec5ed3b47a
2018-01-07 23:22:01 +01:00
Jeff Hemphill 73c0663aec Bug 1425807 - Convert nsHostKey members to nsCString r=valentin
MozReview-Commit-ID: 8tZUukA8Rrk

--HG--
extra : rebase_source : 4877c8eef1c2fd3a630316641d492189663acc61
2017-12-22 14:08:17 -08:00
Valentin Gosu a7fe7a006d Bug 1424834 - Replace nsHostRecord.callbacks with LinkedList<RefPtr<nsResolveHostCallback>> r=mayhemer
* nsResolveHostCallback extends nsISupports (for addref-ing and because nsDNSAsyncRequest implements nsICancelable)
* nsResolveHostCallback extends LinkedListElement<RefPtr<nsResolveHostCallback>> so the list can properly manage references
* nsDNSAsyncRequest and nsDNSSyncRequest properly implement nsISupports and use RefPtr to manage lifetimes


MozReview-Commit-ID: 5NvBcWZzfyN

--HG--
extra : rebase_source : 67adcbd20a29803e5abbb3d16324f9cac6771d28
2017-12-20 01:13:46 +01:00
Dorel Luca d9227411a0 Backed out 2 changesets (bug 1424834) for AddressSanitizer failure r=backout a=backout
Backed out changeset 00e1d58aedfe (bug 1424834)
Backed out changeset 9b69f2b7d373 (bug 1424834)
2017-12-19 13:59:02 +02:00
Phil Ringnalda 74065c09ed Backed out changeset fc0b6106be47 (bug 1425807) for static build bustage
CLOSED TREE
2017-12-18 18:31:20 -08:00
Jeff Hemphill 6d1f1c52d8 Bug 1425807 - Convert nsHostKey members to nsCString. r=valentin
MozReview-Commit-ID: 8tZUukA8Rrk

--HG--
extra : source : 966836866e8afe423a01a9926834a26cb3d3e2b0
extra : amend_source : 8602ab726f16bc561fafc5196d05fa9578073471
extra : histedit_source : 724da61db9ba94554bfdb15992a3a2aad18eca14%2C2a576438e92928c4a8196429dbcd76d1bd1eca7d
2017-12-18 11:27:38 -08:00
Csoregi Natalia 10b1db0472 Backed out changeset 966836866e8a (bug 1425807) for Build Bustage. r=backout on a CLOSED TREE 2017-12-19 03:09:04 +02:00
Jeff Hemphill 0e5ba4ebd8 Bug 1425807 - Convert nsHostKey members to nsCString r=valentin
MozReview-Commit-ID: 8tZUukA8Rrk

--HG--
extra : rebase_source : 717e730de9c79f13553fa617c7588805683f18c5
2017-12-18 11:27:38 -08:00
Valentin Gosu d4f5405148 Bug 1424834 - Replace nsHostRecord.callbacks with LinkedList<RefPtr<nsResolveHostCallback>> r=mayhemer
* nsResolveHostCallback extends nsISupports (for addref-ing and because nsDNSAsyncRequest implements nsICancelable)
* nsResolveHostCallback extends LinkedListElement<RefPtr<nsResolveHostCallback>> so the list can properly manage references
* nsDNSAsyncRequest and nsDNSSyncRequest properly implement nsISupports and use RefPtr to manage lifetimes


MozReview-Commit-ID: 5NvBcWZzfyN

--HG--
extra : rebase_source : d8c5c89c35e455c5d8e6556a140a0ef119b95e86
2017-12-15 15:46:24 -06:00
Cosmin Sabou f0ab0b072a Backed out 2 changesets (bug 1424834) for leaks at netwerk/dns/nsHostResolver.cpp:352 r=backout a=backout
Backed out changeset 2503df83bbd9 (bug 1424834)
Backed out changeset 49cc08386f17 (bug 1424834)
2017-12-18 11:52:06 +02:00
Valentin Gosu d2697a43d6 Bug 1424834 - Replace nsHostRecord.callbacks with LinkedList<RefPtr<nsResolveHostCallback>> r=mayhemer
* nsResolveHostCallback extends nsISupports (for addref-ing and because nsDNSAsyncRequest implements nsICancelable)
* nsResolveHostCallback extends LinkedListElement<RefPtr<nsResolveHostCallback>> so the list can properly manage references
* nsDNSAsyncRequest and nsDNSSyncRequest properly implement nsISupports and use RefPtr to manage lifetimes


MozReview-Commit-ID: 5NvBcWZzfyN

--HG--
extra : rebase_source : d8c5c89c35e455c5d8e6556a140a0ef119b95e86
2017-12-15 15:46:24 -06:00
Valentin Gosu 10292308b3 Bug 1424066 - Rename nsResolveHostCallback.OnLookupComplete and nsHostResolver.OnLookupComplete r=mayhemer
We have several different methods called OnLookupComplete, with similar but different arguments.
This makes it difficult to reason about the code, when lots of methods are called the same.

* renames nsResolveHostCallback.OnLookupComplete to nsResolveHostCallback.OnResolveHostComplete
* renames nsHostResolver.OnLookupComplete to nsHostResolver.CompleteLookup

MozReview-Commit-ID: AeWTErs4OQM

--HG--
extra : rebase_source : 6d06b50c1fa2ba678a887b93f28e1e602e209da4
2017-12-07 23:19:48 +01:00
Valentin Gosu 95aaaa5773 Bug 1422173 - Backed out changeset 27719294cb73 (Bug 1420677) r=me
MozReview-Commit-ID: 7iSG4279EfL
2017-12-04 16:02:59 +01:00
Jeff Hemphill bc64b6ad42 Bug 1420677 - Convert nsHostResolver.addr_info to a UniquePtr. r=valentin
MozReview-Commit-ID: 4zX73VhxiKe
2017-11-25 23:55:26 -08:00
Jeff Hemphill 91d2efb8b5 Bug 1420673: Use UniquePtr to store nsHostResolver.addr r=valentin
MozReview-Commit-ID: Arrm0stdtNL

--HG--
extra : rebase_source : 24c9c9db0bfcfce435b244119b088e90cb6c4061
extra : source : 1bade2a7b61167128f9cef4b543dd0bcef6295e4
2017-11-25 23:37:24 -08:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Tim Huang defed589eb Bug 1337893 - Part 2: Making the DNS cache be aware of originAttributes. r=valentin
MozReview-Commit-ID: EroJiwwkGHa

--HG--
extra : rebase_source : 409730ef008b02373cc547a890224371806fbf4c
2017-02-14 12:25:35 +08:00
Valentin Gosu fe9b24270d Bug 1301069 - Backed out bug 1185120 (changeset 38cad72a77a6) a=backout a=merge
--HG--
extra : source : 9330dc01ec0245f05311c56025a50705138351bc
2016-09-08 00:04:07 +02:00
Yen Chi Hsuan 5a098d36c7 Bug 1185120 - Convert raw pointers in DNS.cpp and nsHostResolver.cpp to smart pointers. r=valentin 2016-09-05 03:47:58 +08:00
Valentin Gosu 0779b66d18 Bug 1228640 - Backout bug 1183781 (changeset b9b6a1567ef6) for causing crash a=me 2015-11-28 00:20:01 +01:00
Valentin Gosu 8a5616fdc5 Bug 1183781 - Small leak in DNS.cpp and nsHostResolver.cpp r=sworkman
* makes AddrInfo extend nsISupports
* uses RefPtr for managing AddrInfo and nsHostResolver in nsHostResolver.cpp
2015-11-23 13:02:41 +01:00
Jonathan Watt de2eb25725 Bug 1216370 - For safety and searchability, define the nsHostResolver::RES_* enum in terms of the nsIDNSService::RESOLVE_* enum. r=mayhemer 2015-09-14 14:46:47 +01:00
Nicholas Nethercote 647b520991 Bug 1201135 - Rename pldhash.{h,cpp} to PLDHashTable.{h,cpp}. r=mccr8.
--HG--
rename : xpcom/glue/pldhash.cpp => xpcom/glue/PLDHashTable.cpp
rename : xpcom/glue/pldhash.h => xpcom/glue/PLDHashTable.h
extra : rebase_source : 06b9d30db96ed78500fd44d9c0b51609103508a3
2015-09-15 20:49:53 -07:00
Patrick McManus 1f37202f72 Bug 1196237 - Relemetry after dns shutdown. r=dragana 2015-08-20 12:14:40 -04:00
Nicholas Nethercote e849e6588b Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj.
--HG--
extra : rebase_source : 9510ea47204fffa163cac43aeaaac6ae1ad80419
2015-05-19 16:46:17 -07:00
Nicholas Nethercote a6d3fc9f49 Bug 1166598 (part 8) - Use PLDHashTable2 in nsHostResolver. r=froydnj. 2015-05-12 17:33:45 -07:00
Patrick McManus 59395b21cb bug 1162821 - filter dns name collision records r=sworkman IGNORE IDL 2015-05-08 14:18:20 -04:00
Dragana Damjanovic 82480b23f3 Bug 1108957 - Add per network interface dns query. This is possible only with gonk. r=mayhemer 2015-02-19 00:14:00 -05:00
Dragana Damjanovic bcda688027 Bug 1123324 - Additional fix for nsHostResolver. r=sworkman 2015-02-10 08:45:00 -05:00
Dragana Damjanovic 0b608c2cf0 Bug 1123324 - Fix host resolve. r=sworkman 2015-02-03 00:16:00 -05:00
Steve Workman eafabe3cdc Bug 1084645 - Enable DNS TTL by default on Windows r=mcmanus 2014-10-20 10:26:33 -07:00
Daniel Stenberg 550c6f65bf Bug 1077084 - improved DNS cache pruning. r=sworkman 2014-10-13 23:07:00 +02:00
Daniel Stenberg e3a15e4b5d Bug 939318 - Detect network interface changes on Windows. r=mcmanus
Now supports IPv6 as well if a new enough windows version is used.
Which notification function to use is detect at run-time.

Now sends CHANGED event if the online interface(s) are different in any
way since it was previously checked and considered UP. CHANGED is sent
before UP in case both are detected. It does not send any CHANGED events
during the first 2 seconds after startup.

nIOService: split up the network event receiver function from the
network status init function and have the event receiver act on the
incoming event.

DNSservice: acts on network changes (flushes the host cache and restarts
ongoing name resolves)

HttpHandler: acts on network changes
2014-09-24 23:14:00 -04:00
Steve Workman 2f4a61e5cb Bug 1070966 - Change WrapRunnableNM to NS_NewRunnableMethodWithArg r=mcmanus 2014-09-24 09:56:13 -07:00
Ed Morley 0b6dc6427d Backed out changeset 89d06d103c10 (bug 939318) for Valgrind failures; CLOSED TREE 2014-09-24 16:17:57 +01:00
Daniel Stenberg 3984adf1be Bug 939318 - Detect network interface changes on windows. r=mcmanus
Now supports IPv6 as well if a new enough windows version is used.
Which notification function to use is detect at run-time.

Now sends CHANGED event if the online interface(s) are different in any
way since it was previously checked and considered UP. CHANGED is sent
before UP in case both are detected. It does not send any CHANGED events
during the first 2 seconds after startup.

nIOService: split up the network event receiver function from the
network status init function and have the event receiver act on the
incoming event.

DNSservice: acts on network changes (flushes the host cache and restarts
ongoing name resolves)

HttpHandler: acts on network changes
2014-09-23 03:48:00 -04:00
John Sullivan b691107c76 Bug 1067679 - Call DnsQuery in addition to getaddrinfo to get DNS TTL on Windows r=sworkman 2014-09-20 15:10:18 -07:00
Patrick McManus de7e1803bc Bug 820391 - Backout revision 4741ef815af9 for various regressions.
DONTBUILD
2014-08-21 10:53:11 -04:00
Ryan VanderMeulen 30e63485d6 Backed out changeset 49502f43bd03 for landing with the wrong bug number. 2014-08-21 11:03:02 -04:00
Patrick McManus d8cd53790d bug 820931 - backout 4741ef815af9 r=backout
--HG--
extra : rebase_source : d862e877dd3d28df5322b3464e3c0b10a460a56d
2014-08-21 10:53:11 -04:00
josullivan fa4f761593 Bug 820391: Use DnsQuery on Windows. r=sworkman
From 21e22e494541d5e4c085a6ba84e1bc5b4c92330e Mon Sep 17 00:00:00 2001
---
 netwerk/dns/DNS.cpp            |  65 +++++++-
 netwerk/dns/DNS.h              |   6 +
 netwerk/dns/GetAddrInfo.cpp    | 362 +++++++++++++++++++++++++++++++++++++++++
 netwerk/dns/GetAddrInfo.h      |  65 ++++++++
 netwerk/dns/moz.build          |   1 +
 netwerk/dns/nsHostResolver.cpp | 320 ++++++++++++++++++++++++++----------
 netwerk/dns/nsHostResolver.h   |  43 ++++-
 7 files changed, 766 insertions(+), 96 deletions(-)
 create mode 100644 netwerk/dns/GetAddrInfo.cpp
 create mode 100644 netwerk/dns/GetAddrInfo.h
2014-08-15 17:25:06 -07:00
Ehsan Akhgari 748c8aca19 Bug 1048271 - Fix more bad implicit constructors in netwerk; r=mcmanus 2014-08-05 09:20:24 -04:00
Patrick McManus 7d75165d03 bug 982565 - make dns ttl and grace period prefs respect 1s granularity r=sworkman 2014-03-09 06:01:56 -04:00
Nicholas Hurley 21710e9462 Bug 957759 - Remove SRV experiment code (helps prevent crashes). r=mcmanus 2014-01-09 13:50:04 -08:00
Nicholas Hurley f18b3e02a2 Bug 942317 - An experiment to test how reachable SRV records are in the wild. r=mcmanus 2013-12-05 15:23:22 -08:00
Nicholas Nethercote 9aa62569a7 Bug 893857 (part 2) - Add a memory reporter for the DNS service. r=sworkman.
--HG--
extra : rebase_source : 7d88cf2ef5ad4b58b377f0cec66349b5e26bfc8e
2013-11-24 15:24:12 -08:00