From af8824af3546d78a9bf42b35f18f78e310e53946 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 Apr 2018 11:26:04 +0200 Subject: [PATCH] bug 1455972 - make TRR prefer address responses to CNAME r=mcmanus In a DOH response to a query asking for an A or AAAA record, a CNAME response is often accompanied by A/AAAA resources as well. With this change, TRR now rather use those address records than following the CNAME record. This saves name resolver round-trips. MozReview-Commit-ID: GcjZj5Ehz68 --HG-- extra : rebase_source : b80d9818cb8fa6139feeeec3d2fb11a5b800ee48 --- netwerk/dns/TRR.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/dns/TRR.cpp b/netwerk/dns/TRR.cpp index da7b59bf9568..fe7c0e90f5e8 100644 --- a/netwerk/dns/TRR.cpp +++ b/netwerk/dns/TRR.cpp @@ -819,7 +819,7 @@ TRR::On200Response() nsresult rv = DohDecode(); if (NS_SUCCEEDED(rv)) { - if (!mCname.IsEmpty()) { + if (!mDNS.mAddresses.getFirst() && !mCname.IsEmpty()) { if (!--mCnameLoop) { LOG(("TRR::On200Response CNAME loop, eject!\n")); } else {