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

PowerDNS / pdns / 13494306182

24 Feb 2025 09:01AM UTC coverage: 60.607% (-1.6%) from 62.24%
13494306182

Pull #15203

github

web-flow
Merge 023bafd01 into 83beff6d6
Pull Request #15203: rec: switch back to serde_yaml

34838 of 90428 branches covered (38.53%)

Branch coverage included in aggregate %.

25 of 25 new or added lines in 1 file covered. (100.0%)

6482 existing lines in 72 files now uncovered.

120907 of 166548 relevant lines covered (72.6%)

4692544.6 hits per line

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

0.0
/pdns/recursordist/rec-xfrtracker.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 "rec-xfr.hh"
24
#include "dnsname.hh"
25

26
LockGuarded<std::multimap<DNSName, ZoneXFR::ZoneWaiter&>> ZoneXFR::condVars;
27

28
// Notify all threads tracking the zone name
29
bool ZoneXFR::notifyZoneTracker(const DNSName& name)
UNCOV
30
{
×
UNCOV
31
  auto lock = condVars.lock();
×
UNCOV
32
  auto [start, end] = lock->equal_range(name);
×
UNCOV
33
  if (start == end) {
×
34
    // Did not find any thread tracking that name
UNCOV
35
    return false;
×
UNCOV
36
  }
×
UNCOV
37
  while (start != end) {
×
UNCOV
38
    start->second.stop = true;
×
UNCOV
39
    start->second.condVar.notify_one();
×
UNCOV
40
    ++start;
×
UNCOV
41
  }
×
UNCOV
42
  return true;
×
UNCOV
43
}
×
44

45
void ZoneXFR::insertZoneTracker(const DNSName& zoneName, ZoneWaiter& waiter)
UNCOV
46
{
×
UNCOV
47
  auto lock = condVars.lock();
×
UNCOV
48
  lock->emplace(zoneName, waiter);
×
UNCOV
49
}
×
50

51
void ZoneXFR::clearZoneTracker(const DNSName& zoneName)
52
{
×
53
  // Zap our (and only our) ZoneWaiter struct out of the multimap
54
  auto lock = condVars.lock();
×
55
  auto [start, end] = lock->equal_range(zoneName);
×
56
  while (start != end) {
×
57
    if (start->second.id == std::this_thread::get_id()) {
×
58
      lock->erase(start);
×
59
      break;
×
60
    }
×
61
    ++start;
×
62
  }
×
63
}
×
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