From: Pieter Lexis Date: Tue, 4 Sep 2018 07:44:05 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' into ixfrdist-limit-size X-Git-Tag: auth-4.2.0-beta1~1^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18d9ed745d4a8bc0da856c8aa8f41a112b08fe0f;p=thirdparty%2Fpdns.git Merge remote-tracking branch 'origin/master' into ixfrdist-limit-size --- 18d9ed745d4a8bc0da856c8aa8f41a112b08fe0f diff --cc pdns/ixfrdist.cc index 0c516fdce9,a3e0a5db72..8174a1c40d --- a/pdns/ixfrdist.cc +++ b/pdns/ixfrdist.cc @@@ -206,7 -219,20 +219,20 @@@ static void makeIXFRDiff(const records_ } } + /* you can _never_ alter the content of the resulting shared pointer */ + static std::shared_ptr getCurrentZoneInfo(const DNSName& domain) + { + std::lock_guard guard(g_soas_mutex); + return g_soas[domain]; + } + + static void updateCurrentZoneInfo(const DNSName& domain, std::shared_ptr& newInfo) + { + std::lock_guard guard(g_soas_mutex); + g_soas[domain] = newInfo; + } + -void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout) { +void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint32_t axfrMaxRecords) { std::map lastCheck; // Initialize the serials we have @@@ -297,12 -329,12 +329,12 @@@ // The *new* SOA shared_ptr soa; + records_t records; try { AXFRRetriever axfr(master, domain, tt, &local); - unsigned int nrecords=0; + uint32_t nrecords=0; Resolver::res_t nop; vector 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))) {