Commit Graph

1840 Commits

Author SHA1 Message Date
Nihanth Subramanya
acc81306ba Bug 1699998 - Extract the Enabled() check in TRRService::IsDomainBlocked into TRR::MaybeBlockRequest. r=necko-reviewers,valentin
Currently, we are checking Enabled() without passing the request mode in IsDomainBlocked.
This isn't the right place to do this, it's cleaner if IsDomainBlocked trusts the caller
to have checked Enabled already. We should call Enabled, with the request mode, in
TRR::MaybeBlockDomain() and return early if it's false.

Differential Revision: https://phabricator.services.mozilla.com/D109240
2021-03-21 20:20:34 +00:00
Valentin Gosu
45d5e3c349 Bug 1658278 - Add TRR confirmation test r=necko-reviewers,dragana,nhnt11
Also adds nsIDNSService.currentTrrConfirmationState IDL method for test use

Differential Revision: https://phabricator.services.mozilla.com/D108999
2021-03-19 17:51:27 +00:00
Valentin Gosu
47cd0f08de Bug 1658278 - Split TRR's CONFIRM_TRYING into CONFIRM_TRYING_OK and CONFIRM_TRYING_FAILED r=necko-reviewers,nhnt11,dragana,preferences-reviewers
- Adds CONFIRM_TRYING_FAILED confirmation state. We use this state when we retry confirmation after confirmation fails.
- Rename CONFIRM_TRYING to CONFIRM_TRYING_OK. We use this state when we try confirmation but no confirmation failure has happened.
- Rename CONFIRM_INIT to CONFIRM_OFF. We use this state whenever there is an event that would disable TRR - such as a TRR mode change.
- Add CONFIRM_DISABLED confirmation state. We use this state in mode3 or when confirmationNS=="skip"
- To potentially allow us to have the same behaviour as after Bug 1689113, specifically the we might be able to report TRRService::Enabled = true when retrying and the state is CONFIRM_TRYING_FAILED we added `network.trr.attempt-when-retrying-confirmation`
- After a large number of TRR failures occurs, we immediately trigger another confirmation and go into CONFIRM_TRYING_OK. This allows us to cope with a temporary increase in network latency that is smaller than 6s.
- We no longer trigger confirmation for nsIRequest::TRR_FIRST_MODE when the resolver mode is not TRR_FIRST. This allows us to simplify the code.
- test_trr_proxy.js now calls trr_test_setup() after it sets up the pac script to avoid confirmation causing non-local connections in tests.
- Moves all the confirmation state handing into HandleConfirmationEvent

Differential Revision: https://phabricator.services.mozilla.com/D107666
2021-03-19 17:51:26 +00:00
Valentin Gosu
8e80fa3f32 Bug 1658278 - Move member initialization to header file r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D107665
2021-03-19 17:51:26 +00:00
Valentin Gosu
0aea403b8a Bug 1658278 - Treat calls to TRRService::CompleteLookup differently based on the purpose of the TRR request r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D107664
2021-03-19 17:51:25 +00:00
Kershaw Chang
02a4432e92 Bug 1698015 - Add another way to download ODoHConfigs via https r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D108174
2021-03-19 08:29:14 +00:00
ffxbld
10763f5ccf No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D108949
2021-03-18 14:52:53 +00:00
Simon Giesecke
b9621d6376 Bug 1695162 - Use range-based for instead of custom hashtable iterators. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D108585
2021-03-17 15:49:46 +00:00
ffxbld
b6c0f67943 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D108456
2021-03-15 14:52:33 +00:00
Byron Campen [:bwc]
f05c58546c Bug 1696593: Ensure that the DNS service is initted (on main) before trying to init NrIceCtx. r=mjf,kershaw,necko-reviewers
Also add some NS_WARN_IF that helped find the bug.

Differential Revision: https://phabricator.services.mozilla.com/D107508
2021-03-11 21:03:30 +00:00
Simon Giesecke
ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Kershaw Chang
b23dcf46c1 Bug 1695917 - Optimize the way we get DNS service in DnsAndConnectSocket r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106918
2021-03-09 07:58:48 +00:00
ffxbld
082221c65a No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D107469
2021-03-08 14:53:46 +00:00
ffxbld
53e685af65 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D107218
2021-03-04 15:07:19 +00:00
Valentin Gosu
d83402f7b1 Bug 1513519 - Always hold lock when accessing mResolver r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106913
2021-03-04 10:14:59 +00:00
Valentin Gosu
a13ad605e4 Bug 1694949 - Add event telemetry containing failure reasons that lead to TRR confirmation failure r=nhnt11,dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106618
2021-03-03 14:32:24 +00:00
Simon Giesecke
8ecfb38a41 Bug 1691913 - Remove uses of nsDataHashtable::GetValue. r=xpcom-reviewers,necko-reviewers,dragana,nika
GetValue is going to be removed in a subsequent patch. It is no longer needed,
because it can be replaced by functions already provided by nsBaseHashtable,
in particular Lookup and Contains.

Also, its name was confusing, since it specifically returns a pointer that
allows and is intended for modifying the entry within the hashtable, rather
than returning by-value. According to the naming rules to be set on
nsBaseHashtable, it would also needed to be renamed to "Lookup*. Removing
its uses saves this effort.

Differential Revision: https://phabricator.services.mozilla.com/D105476
2021-03-01 09:59:30 +00:00
ffxbld
bbc3cab1b3 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D106685
2021-02-27 00:22:47 +00:00
Simon Giesecke
0b443059fd Bug 1693306 - Simplify some uses of LookupOrInsertWith by GetOrInsertNew. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D105479
2021-02-26 09:22:54 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke
4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Kershaw Chang
c7dc3fd5c1 Bug 1688092 - Make sure mTrrA and mTrrAAAA are set properly before dispatching them r=necko-reviewers,valentin
See [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1694628#c1 | bug 1694628 ]] for details.

Differential Revision: https://phabricator.services.mozilla.com/D106415
2021-02-25 13:07:04 +00:00
Kershaw Chang
ef06b68b6c Bug 1688092 - Update ODoHConfigs when the TTL expires r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D106075
2021-02-25 13:07:04 +00:00
Valentin Gosu
40eb1379d9 Bug 1694457 - Add pref for reporting confirmation event telemetry r=nhnt11,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106264
2021-02-25 12:52:28 +00:00
Valentin Gosu
86622ba6a3 Bug 1694604 - Fix static analysis warnings in netwerk/dns r=necko-reviewers,dragana
Depends on D106262

Differential Revision: https://phabricator.services.mozilla.com/D106263
2021-02-24 16:37:04 +00:00
Valentin Gosu
ff32c214b6 Bug 1694604 - Move TRRSkippedReason out of nsHostResolver.h r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106262
2021-02-24 16:37:03 +00:00
Nihanth Subramanya
b88988a027 Bug 1460314 - TRR: add telemetry probe for used HTTP version. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D100519
2021-02-22 14:43:15 +00:00
Valentin Gosu
a9cce9ac08 Bug 1646452 - Key TRR telemetry by domain of DoH server r=nhnt11,necko-reviewers,dragana
This allows us to separate general TRR performance issues from "this user's
custom DoH server is slow or malfunctioning".
Any DoH servers domains that are not shipped by Firefox are reported as (other).

Differential Revision: https://phabricator.services.mozilla.com/D105602
2021-02-22 13:51:44 +00:00
Simon Giesecke
7c931c97c4 Bug 1689218 - Rename nsBaseHashtable::GetAndRemove to Extract. r=necko-reviewers,dragana
First, it should be called "Lookup" rather than "Get" because it returns
DataType (rather than UserDataType), but that would still be confusing,
since as opposed to other Lookup* methods, it does not return a DataType&
(and obviously, it can't). So "Extract" seems to be a better name, cf.
mozilla::Maybe::extract.

Differential Revision: https://phabricator.services.mozilla.com/D105471
2021-02-22 12:07:48 +00:00
Simon Giesecke
d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Valentin Gosu
63e49eada8 Bug 1692494 - TRR_NXDOMAIN no longer recorded when 0x03 rcode is set in the TRR response header r=nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D105311
2021-02-22 09:12:22 +00:00
ffxbld
782a30533f No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D105627
2021-02-19 10:22:03 +00:00
Kershaw Chang
27c050e058 Bug 1689987 - Fix build error. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D105648
2021-02-18 16:39:30 +00:00
Kershaw Chang
36d1df148d Bug 1689987 - P4: Add a telemetry probe to collect channel success rate when ODoH is used r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D105214
2021-02-18 12:50:03 +00:00
Kershaw Chang
9795f890cc Bug 1689987 - P3: Add some ODoH specific skip reasons r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104831
2021-02-18 12:50:03 +00:00
Kershaw Chang
782c896152 Bug 1689987 - P2: Add DNS_ODOH_LOOKUP_TIME and ODOH_SKIP_REASON_ODOH_FIRST probes r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104800
2021-02-18 12:50:02 +00:00
Kershaw Chang
a2532cb1f3 Bug 1689987 - P1: Don't mess up TRR telemetry when ODoH is used r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104799
2021-02-18 12:50:02 +00:00
Valentin Gosu
efa654d3d5 Bug 1691408 - Record confirmation event telemetry r=nhnt11,dragana,necko-reviewers
- Adds new TRR* argument to CompleteLookup so we can extract the channel
  status from the TRR request.
- Record event whenever the confirmation context changes
- NetworkID is recorded whenever we start a new confirmation attempt
- Captive portal status is updated based on observer notifications
- We keep a buffer of the last 32 confirmation results.

Differential Revision: https://phabricator.services.mozilla.com/D105173
2021-02-17 10:26:41 +00:00
Valentin Gosu
e5e0b8d7a7 Bug 1691408 - Move DNS_TRR_NS_VERFIFIED2 accumulation out of conditional block r=nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D105172
2021-02-17 10:26:40 +00:00
Valentin Gosu
50bee9f5dd Bug 1691933 - Increase timeout for TRR confirmation request r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D104677
2021-02-17 10:26:39 +00:00
Simon Giesecke
ca94ec101e Bug 1691894 - Simplify uses of GetOrInsert where non-default-constructed entries are eventually inserted. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104674
2021-02-15 16:37:52 +00:00
Simon Giesecke
780a1636a9 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 15:12:17 +00:00
ffxbld
0e6befe413 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D105197
2021-02-15 14:55:51 +00:00
smolnar
1afbbe67e1 Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke
8973094ec1 Bug 1691894 - Replace several suboptimal uses of Put after Get by GetOrInsertWith or WithEntryHandle. r=xpcom-reviewers,necko-reviewers,kmag,valentin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D104849
2021-02-15 10:04:45 +00:00
Sylvestre Ledru
b4f9be25d4 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D105158
2021-02-15 08:49:20 +00:00
Simon Giesecke
f701c44a5c Bug 1691894 - Fix EntryHandle to only work with DataType rather than wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika,jonco,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104810
2021-02-12 15:25:40 +00:00
ffxbld
2a5a3fe221 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D104827
2021-02-11 16:31:23 +00:00
Simon Giesecke
5ab2e2fc52 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in netwerk. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D104197
2021-02-09 18:19:37 +00:00
Valentin Gosu
33aa2bcb05 Bug 1691721 - Add DNSPacket::GetRCode and remove TRRSkippedReason argument r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D99760
2021-02-09 14:22:56 +00:00