]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: stop maintaining vector of backend instances 15689/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 Jun 2025 09:47:11 +0000 (11:47 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 Jun 2025 09:47:11 +0000 (11:47 +0200)
Unused. Fixes #15688

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/ueberbackend.cc
pdns/ueberbackend.hh

index 0cd8211ff284aac29b7d5ebb07f3252490a48f75..f686ac59dfe099284484a431f56f52dbdea6f177 100644 (file)
@@ -41,8 +41,6 @@
 
 extern StatBag S;
 
-LockGuarded<vector<UeberBackend*>> UeberBackend::d_instances;
-
 // initially we are blocked
 bool UeberBackend::d_go = false;
 bool UeberBackend::s_doANYLookupsOnly = false;
@@ -717,10 +715,6 @@ bool UeberBackend::autoPrimaryBackend(const string& ipAddr, const ZoneName& doma
 
 UeberBackend::UeberBackend(const string& pname)
 {
-  {
-    d_instances.lock()->push_back(this); // report to the static list of ourself
-  }
-
   d_cache_ttl = ::arg().asNum("query-cache-ttl");
   d_negcache_ttl = ::arg().asNum("negquery-cache-ttl");
 
@@ -791,13 +785,7 @@ void UeberBackend::alsoNotifies(const ZoneName& domain, set<string>* ips)
 
 UeberBackend::~UeberBackend()
 {
-  DLOG(g_log << Logger::Error << "UeberBackend destructor called, removing ourselves from instances, and deleting our backends" << endl);
-
-  {
-    auto instances = d_instances.lock();
-    [[maybe_unused]] auto end = remove(instances->begin(), instances->end(), this);
-    instances->resize(instances->size() - 1);
-  }
+  DLOG(g_log << Logger::Error << "UeberBackend destructor called, deleting our backends" << endl);
 
   backends.clear();
 }
index af85b1a541b88e7f1f3f923b7562799a35be478e..d9a0b7cb9400628b0cbe31a6f468d15e7ec58cb0 100644 (file)
@@ -53,11 +53,6 @@ public:
   bool autoPrimaryRemove(const struct AutoPrimary& primary);
   bool autoPrimariesList(std::vector<AutoPrimary>& primaries);
 
-  /** Tracks all created UeberBackend instances for us. We use this vector to notify
-      existing threads of new modules
-  */
-  static LockGuarded<vector<UeberBackend*>> d_instances;
-
   static bool loadmodule(const string& name);
   static bool loadModules(const vector<string>& modules, const string& path);