• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 19741624072

27 Nov 2025 03:45PM UTC coverage: 73.086% (+0.02%) from 73.065%
19741624072

Pull #16570

github

web-flow
Merge 08a2cdb1d into f94a3f63f
Pull Request #16570: rec: rewrite all unwrap calls in web.rs

38523 of 63408 branches covered (60.75%)

Branch coverage included in aggregate %.

128044 of 164496 relevant lines covered (77.84%)

6531485.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.03
/pdns/dnsdistdist/dnsdist-frontend.cc
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22

23
#include "dnsdist-frontend.hh"
24
#include "dnsdist.hh"
25
#include "dnsdist-configuration.hh"
26

27
namespace dnsdist
28
{
29

30
const std::vector<std::shared_ptr<ClientState>>& getFrontends()
31
{
2,314✔
32
  return dnsdist::configuration::getImmutableConfiguration().d_frontends;
2,314✔
33
}
2,314✔
34

35
std::vector<std::shared_ptr<DNSCryptContext>> getDNSCryptFrontends(bool udpOnly)
36
{
34✔
37
  std::vector<std::shared_ptr<DNSCryptContext>> results;
34✔
38
  for (const auto& frontend : getFrontends()) {
140✔
39
    if (frontend->getProtocol() == dnsdist::Protocol::DNSCryptUDP || (!udpOnly && frontend->getProtocol() == dnsdist::Protocol::DNSCryptTCP)) {
140!
40
      results.push_back(frontend->dnscryptCtx);
38✔
41
    }
38✔
42
  }
140✔
43
  return results;
34✔
44
}
34✔
45

46
std::vector<std::shared_ptr<TLSFrontend>> getDoTFrontends()
47
{
32✔
48
  std::vector<std::shared_ptr<TLSFrontend>> results;
32✔
49
  for (const auto& frontend : getFrontends()) {
90✔
50
    if (frontend->getProtocol() == dnsdist::Protocol::DoT) {
90✔
51
      results.push_back(frontend->tlsFrontend);
30✔
52
    }
30✔
53
  }
90✔
54
  return results;
32✔
55
}
32✔
56

57
std::vector<std::shared_ptr<DOHFrontend>> getDoHFrontends()
58
{
317✔
59
  std::vector<std::shared_ptr<DOHFrontend>> results;
317✔
60
  for (const auto& frontend : getFrontends()) {
1,000✔
61
    if (frontend->getProtocol() == dnsdist::Protocol::DoH) {
1,000✔
62
      results.push_back(frontend->dohFrontend);
248✔
63
    }
248✔
64
  }
1,000✔
65
  return results;
317✔
66
}
317✔
67

68
std::vector<std::shared_ptr<DOQFrontend>> getDoQFrontends()
69
{
2✔
70
  std::vector<std::shared_ptr<DOQFrontend>> results;
2✔
71
  for (const auto& frontend : getFrontends()) {
2!
72
    if (frontend->getProtocol() == dnsdist::Protocol::DoQ) {
×
73
      results.push_back(frontend->doqFrontend);
×
74
    }
×
75
  }
×
76
  return results;
2✔
77
}
2✔
78

79
std::vector<std::shared_ptr<DOH3Frontend>> getDoH3Frontends()
80
{
2✔
81
  std::vector<std::shared_ptr<DOH3Frontend>> results;
2✔
82
  for (const auto& frontend : getFrontends()) {
2!
83
    if (frontend->getProtocol() == dnsdist::Protocol::DoH3) {
×
84
      results.push_back(frontend->doh3Frontend);
×
85
    }
×
86
  }
×
87
  return results;
2✔
88
}
2✔
89
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc