]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move the setQuerySource() method to a wrapper in the syncres test code. 7651/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 2 Apr 2019 08:08:53 +0000 (08:08 +0000)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 2 Apr 2019 08:08:53 +0000 (08:08 +0000)
pdns/recursordist/test-syncres_cc.cc
pdns/syncres.hh

index baccecf5ed47644a166bf19ae604c5671f277eb6..e6e6acee24cc8b89f2bfe51e8c0c3e022c8a52ba 100644 (file)
 #include "utility.hh"
 #include "validate-recursor.hh"
 
+// We need the method below for the ECS tests
+class TestSyncRes : public SyncRes {
+public:
+  TestSyncRes(const timeval& now) : SyncRes(now) {}
+  void setQuerySource(const ComboAddress& requestor, boost::optional<const EDNSSubnetOpts&> incomingECS) {
+    setIncomingECSFound();
+    setIncomingECS(incomingECS);
+  }
+};
+
+#define SyncRes TestSyncRes
+
 RecursorStats g_stats;
 GlobalStateHolder<LuaConfigItems> g_luaconfs;
 thread_local std::unique_ptr<MemRecursorCache> t_RC{nullptr};
index a6a29f5345bd5efc0e43767a1ddd93ee31736375..a1be15465eb0b7b6afa4390f09adbecf7776e539 100644 (file)
@@ -639,12 +639,6 @@ public:
     d_skipCNAMECheck = skip;
   }
 
-  void setQuerySource(const ComboAddress& requestor, boost::optional<const EDNSSubnetOpts&> incomingECS) {
-
-         setIncomingECSFound();
-         setIncomingECS(incomingECS);
-  }
-
   void setIncomingECS(boost::optional<const EDNSSubnetOpts&> incomingECS);
 
 #ifdef HAVE_PROTOBUF