}
}
-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))) {