]> granicus.if.org Git - pdns/commitdiff
added CommunicatorClass::LoadArgsIntoSet and fixed some spelling errors
authorRalph Covelli <rcovelli@he.net>
Fri, 26 May 2017 02:22:01 +0000 (03:22 +0100)
committerRalph Covelli <rcovelli@he.net>
Fri, 26 May 2017 02:22:01 +0000 (03:22 +0100)
docs/markdown/authoritative/settings.md
pdns/communicator.cc
pdns/communicator.hh

index 4bfa49097f96f56ff466125155ae1a21d2d884ad..c93637bb3a1296d470ad0d5e173320f981fb0083 100644 (file)
@@ -364,10 +364,10 @@ Forward DNS updates sent to a slave to the master.
 ## `forward-notify`
 * IP addresses, separated by commas
 
-IP addresses to send received notifications to regardless of master or slave settings.
+IP addresses to forward received notifications to regardless of master or slave settings.
 
 Note: The intended use is in anycast environments where it might be necessary for a
-proxy server to preform the AXFR.  The usual checks are preformed before any received
+proxy server to perform the AXFR.  The usual checks are performed before any received
 notification is forwarded.
 
 ## `guardian`
index 7cd6955d86457e036ce7badf5d6c6966246afdda..dc12ff99612e0a7383e70f915f0687f27df9b3d3 100644 (file)
 #include "arguments.hh"
 #include "packetcache.hh"
 
-#define CommunicatorLoadArgsIntoSet(listname, listset) do {                                \
-  vector<string> parts;                                                                    \
-  stringtok(parts, ::arg()[(listname)], ", \t");                                           \
-  for (vector<string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) { \
-    try {                                                                                  \
-      ComboAddress caIp(*iter, 53);                                                        \
-      (listset).insert(caIp.toStringWithPort());                                           \
-    }                                                                                      \
-    catch(PDNSException &e) {                                                              \
-      L<<Logger::Error<<"Unparseable IP in "<<(listname)<<". Error: "<<e.reason<<endl;     \
-      exit(1);                                                                             \
-    }                                                                                      \
-  }                                                                                        \
-} while(0)
-
 // there can be MANY OF THESE
 void CommunicatorClass::retrievalLoopThread(void)
 {
@@ -70,6 +55,22 @@ void CommunicatorClass::retrievalLoopThread(void)
   }
 }
 
+void CommunicatorClass::LoadArgsIntoSet(const char *listname, set<string> &listset)
+{
+  vector<string> parts;
+  stringtok(parts, ::arg()[listname], ", \t");
+  for (vector<string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter) {
+    try {
+      ComboAddress caIp(*iter, 53);
+      listset.insert(caIp.toStringWithPort());
+    }
+    catch(PDNSException &e) {
+      L<<Logger::Error<<"Unparseable IP in "<<listname<<". Error: "<<e.reason<<endl;
+      exit(1);
+    }
+  }
+}
+
 void CommunicatorClass::go()
 {
   try {
@@ -95,9 +96,9 @@ void CommunicatorClass::go()
     exit(1);
   }
 
-  CommunicatorLoadArgsIntoSet("also-notify", d_alsoNotify);
+  LoadArgsIntoSet("also-notify", d_alsoNotify);
 
-  CommunicatorLoadArgsIntoSet("forward-notify", PacketHandler::s_forwardNotify);
+  LoadArgsIntoSet("forward-notify", PacketHandler::s_forwardNotify);
 }
 
 void CommunicatorClass::mainloop(void)
index babab1cfb15ce76a83e74d7affdc3db0cf25927a..f4c543874f5d02fb01f35ca9381786f35eb5f3c0 100644 (file)
@@ -187,6 +187,7 @@ public:
   }
   bool notifyDomain(const DNSName &domain);
 private:
+  void LoadArgsIntoSet(const char *listname, set<string> &listset);
   void makeNotifySockets();
   void queueNotifyDomain(const DomainInfo& di, UeberBackend* B);
   int d_nsock4, d_nsock6;