]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Mark a few methods non-const, to allow the guard to not be mutable, as suggested...
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 28 Sep 2022 11:38:11 +0000 (13:38 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 28 Sep 2022 11:38:11 +0000 (13:38 +0200)
pdns/fstrm_logger.hh
pdns/remote_logger.hh

index c2187602a333d1291eaf42737ce0d9c63ea4b2a7..7147a471c0975e0f789ecbf1ad5e38cf56d54d05 100644 (file)
@@ -49,12 +49,12 @@ public:
   {
     return "dnstap";
   }
-  std::string toString() const override
+  std::string toString() override
   {
     return "FrameStreamLogger to " + d_address + " (" + std::to_string(d_framesSent) + " frames sent, " + std::to_string(d_queueFullDrops) + " dropped, " + std::to_string(d_permanentFailures) + " permanent failures)";
   }
 
-  RemoteLoggerInterface::Stats getStats() const override
+  RemoteLoggerInterface::Stats getStats() override
   {
     return Stats{.d_queued = d_framesSent,
                  .d_pipeFull = d_queueFullDrops,
index 1b126b403cb8191440ef84a0884d4deeb7b2fb4e..058b0c6c96b33fbf338821b2fbeb90c972baf1f4 100644 (file)
@@ -67,7 +67,7 @@ public:
   virtual ~RemoteLoggerInterface() {};
   virtual Result queueData(const std::string& data) = 0;
   virtual std::string address() const = 0;
-  virtual std::string toString() const = 0;
+  virtual std::string toString() = 0;
   virtual const std::string name() const = 0;
   bool logQueries(void) const { return d_logQueries; }
   bool logResponses(void) const { return d_logResponses; }
@@ -91,7 +91,7 @@ public:
     }
   };
 
-  virtual Stats getStats() const = 0;
+  virtual Stats getStats() = 0;
 
 private:
   bool d_logQueries{true};
@@ -122,13 +122,13 @@ public:
   {
     return "protobuf";
   }
-  std::string toString() const override
+  std::string toString() override
   {
     auto runtime = d_runtime.lock();
     return d_remote.toStringWithPort() + " (" + std::to_string(runtime->d_stats.d_queued) + " processed, " + std::to_string(runtime->d_stats.d_pipeFull + runtime->d_stats.d_tooLarge + runtime->d_stats.d_otherError) + " dropped)";
   }
 
-  virtual RemoteLoggerInterface::Stats getStats() const override
+  virtual RemoteLoggerInterface::Stats getStats() override
   {
     return d_runtime.lock()->d_stats;
   }
@@ -155,7 +155,7 @@ private:
   std::atomic<bool> d_exiting{false};
   bool d_asyncConnect{false};
 
-  mutable LockGuarded<RuntimeData> d_runtime;
+  LockGuarded<RuntimeData> d_runtime;
   std::thread d_thread;
 };