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

PowerDNS / pdns / 18743945403

23 Oct 2025 09:29AM UTC coverage: 65.845% (+0.02%) from 65.829%
18743945403

Pull #16356

github

web-flow
Merge 8a2027ef1 into efa3637e8
Pull Request #16356: auth 5.0: backport "pdnsutil: fix b2b-migrate to from sql to non-sql"

42073 of 92452 branches covered (45.51%)

Branch coverage included in aggregate %.

128008 of 165855 relevant lines covered (77.18%)

6379935.17 hits per line

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

58.33
/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)
30
{
23✔
31
  auto lock = condVars.lock();
23✔
32
  auto [start, end] = lock->equal_range(name);
23✔
33
  if (start == end) {
23✔
34
    // Did not find any thread tracking that name
35
    return false;
1✔
36
  }
1✔
37
  while (start != end) {
44✔
38
    start->second.stop = true;
22✔
39
    start->second.condVar.notify_one();
22✔
40
    ++start;
22✔
41
  }
22✔
42
  return true;
22✔
43
}
23✔
44

45
void ZoneXFR::insertZoneTracker(const DNSName& zoneName, ZoneWaiter& waiter)
46
{
3✔
47
  auto lock = condVars.lock();
3✔
48
  lock->emplace(zoneName, waiter);
3✔
49
}
3✔
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