]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Faster cache-lookups for DNS over HTTPS queries 11901/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 5 Sep 2022 14:08:36 +0000 (16:08 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 5 Sep 2022 14:11:44 +0000 (16:11 +0200)
commit0c8759d8ad20baa60f784c4487f79cdf03102603
tree4e06225846c695529a3d2a6edab05b0d09d2ce70
parent33161bd52ab7a671104cc453fcd4fa8dd2210a4b
dnsdist: Faster cache-lookups for DNS over HTTPS queries

For DoH queries we do two cache lookups:
- a first one for responses received over UDP, that can be truncated,
  which we do not want here as the client likely would not what to do
  with that
- then on a miss, a second one for responses received over TCP

We do not want the first lookup to override the initial query in
case of a hit for a TC=1 response, so we used to do a copy of the
query (allocation + copy).
This code move the TC=1 check to the cache itself so we do not have
to do that copy, speeding things up.
pdns/dnsdist-cache.cc
pdns/dnsdist-cache.hh
pdns/dnsdist.cc
pdns/test-dnsdistpacketcache_cc.cc