]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
we reinitialized all our statistics function for each rec_control or even API call...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 2 Apr 2014 19:49:00 +0000 (21:49 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 2 Apr 2014 19:49:00 +0000 (21:49 +0200)
pdns/rec_channel.hh
pdns/rec_channel_rec.cc

index aa4ba344bbdfedf86cdfa13167f3cb9b5fe69074..7bd60240e8b5c8a7d7653dc773731a431ec98e2d 100644 (file)
@@ -34,6 +34,8 @@ public:
   static void nop(void){}
   typedef void func_t(void);
   std::string getAnswer(const std::string& question, func_t** func);
+private:
+  static bool s_init;
 };
 
 std::map<std::string, std::string> getAllStatsMap();
index e4bc361ccac3abd53702d69a68658cb2003db62e..4c8c680eb5f287db03088125b6ba54245c978a8b 100644 (file)
@@ -427,8 +427,13 @@ uint64_t doGetMallocated()
 
 extern ResponseStats g_rs;
 
+bool RecursorControlParser::s_init;
 RecursorControlParser::RecursorControlParser()
 {
+  if(s_init)
+    return;
+  s_init=true;
+
   addGetStat("questions", &g_stats.qcounter);
   addGetStat("ipv6-questions", &g_stats.ipv6qcounter);
   addGetStat("tcp-questions", &g_stats.tcpqcounter);