]> granicus.if.org Git - pdns/commitdiff
rec: Ensure we don't hammer the RPZ master server
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 21 Feb 2018 16:37:02 +0000 (17:37 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 12 Mar 2018 14:32:26 +0000 (15:32 +0100)
Before, if the `refresh` was not set in the lua-config file's
`rpzMaster` statement, we would keep trying to get delta's the whole
time. This commit ensures we update the zone's refresh config to the
value from the AXFR'd zone (if not set in the config).

(cherry picked from commit 2c68abe75d908b4a32a7de229c75af137dc3ec5a)

pdns/reczones.cc

index fd42fe9b9e2ea2450a5d2e01c750c087c2453fbb..918a870d97655becfe7531f58fc0b200f366bc24 100644 (file)
@@ -326,9 +326,9 @@ void RPZIXFRTracker(const ComboAddress& master, boost::optional<DNSFilterEngine:
 
   while (!sr) {
     try {
-      sr=loadRPZFromServer(master, zoneName, zone, defpol, maxTTL, tt, maxReceivedBytes, localAddress);
-      if(refresh) {
-        sr->d_st.refresh=refresh;
+      sr=loadRPZFromServer(master, zoneName, zone, defpol, maxTTL, tt, maxReceivedBytes, localAddress, axfrTimeout);
+      if(refresh == 0) {
+        refresh = sr->d_st.refresh;
       }
       zone->setSerial(sr->d_st.serial);
     }
@@ -340,7 +340,11 @@ void RPZIXFRTracker(const ComboAddress& master, boost::optional<DNSFilterEngine:
     }
 
     if (!sr) {
-      sleep(refresh);
+      if (refresh == 0) {
+        sleep(10);
+      } else {
+        sleep(refresh);
+      }
     }
   }