]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge remote-tracking branch 'origin/master' into ixfrdist-limit-size
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 4 Sep 2018 07:44:05 +0000 (09:44 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 4 Sep 2018 07:44:05 +0000 (09:44 +0200)
1  2 
docs/manpages/ixfrdist.yml.5.rst
pdns/ixfrdist.cc

Simple merge
index 0c516fdce96bb7bbb7a5d6afff8e5c36a45c8224,a3e0a5db72fab0dd7303fbc9a5f09b8fb7e1a9c1..8174a1c40d8ef303310b82afd87894a8970d20cc
@@@ -206,7 -219,20 +219,20 @@@ static void makeIXFRDiff(const records_
    }
  }
  
 -void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout) {
+ /* you can _never_ alter the content of the resulting shared pointer */
+ static std::shared_ptr<ixfrinfo_t> getCurrentZoneInfo(const DNSName& domain)
+ {
+   std::lock_guard<std::mutex> guard(g_soas_mutex);
+   return g_soas[domain];
+ }
+ static void updateCurrentZoneInfo(const DNSName& domain, std::shared_ptr<ixfrinfo_t>& newInfo)
+ {
+   std::lock_guard<std::mutex> guard(g_soas_mutex);
+   g_soas[domain] = newInfo;
+ }
 +void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint32_t axfrMaxRecords) {
    std::map<DNSName, time_t> lastCheck;
  
    // Initialize the serials we have
  
        // The *new* SOA
        shared_ptr<SOARecordContent> soa;
+       records_t records;
        try {
          AXFRRetriever axfr(master, domain, tt, &local);
 -        unsigned int nrecords=0;
 +        uint32_t nrecords=0;
          Resolver::res_t nop;
          vector<DNSRecord> chunk;
-         records_t records;
          time_t t_start = time(nullptr);
          time_t axfr_now = time(nullptr);
          while(axfr.getChunk(nop, &chunk, (axfr_now - t_start + axfrTimeout))) {