From: Francis Dupont Date: Tue, 14 Sep 2021 13:08:09 +0000 (+0200) Subject: [#2088] Changed sets by lists X-Git-Tag: Kea-2.0.0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d15eeeab99fbb3200ec7eb1335452174c7ef8d95;p=thirdparty%2Fkea.git [#2088] Changed sets by lists --- diff --git a/src/lib/d2srv/d2_stats.cc b/src/lib/d2srv/d2_stats.cc index 3d3d3b6ff1..8534f13924 100644 --- a/src/lib/d2srv/d2_stats.cc +++ b/src/lib/d2srv/d2_stats.cc @@ -17,14 +17,14 @@ using namespace isc::stats; namespace isc { namespace d2 { -set +const list D2Stats::ncr = { "ncr-received", "ncr-invalid", "ncr-error" }; -set +const list D2Stats::update = { "update-sent", "update-signed", @@ -34,7 +34,7 @@ D2Stats::update = { "update-error" }; -set +const list D2Stats::key = { "update-sent", "update-success", diff --git a/src/lib/d2srv/d2_stats.h b/src/lib/d2srv/d2_stats.h index 4bfd1da7ab..b4122b4910 100644 --- a/src/lib/d2srv/d2_stats.h +++ b/src/lib/d2srv/d2_stats.h @@ -7,7 +7,7 @@ #ifndef D2_STATS_H #define D2_STATS_H -#include +#include #include namespace isc { @@ -21,7 +21,7 @@ public: /// - ncr-received /// - ncr-invalid /// - ncr-error - static std::set ncr; + static const std::list ncr; /// @brief Global DNS update statistics names. /// @@ -31,7 +31,7 @@ public: /// - update-success /// - update-timeout /// - update-error - static std::set update; + static const std::list update; /// @brief Key DNS update statistics names. /// @@ -39,7 +39,7 @@ public: /// - update-success /// - update-timeout /// - update-error - static std::set key; + static const std::list key; /// @brief Initialize D2 statistics. /// diff --git a/src/lib/d2srv/d2_tsig_key.cc b/src/lib/d2srv/d2_tsig_key.cc index 196d278b04..75dc5277a4 100644 --- a/src/lib/d2srv/d2_tsig_key.cc +++ b/src/lib/d2srv/d2_tsig_key.cc @@ -29,6 +29,10 @@ D2TsigKey::D2TsigKey(const Name& key_name, const Name& algorithm_name, initStats(); } +D2TsigKey::~D2TsigKey() { + removeStats(); +} + void D2TsigKey::initStats() { StatsMgr& stats_mgr = StatsMgr::instance(); @@ -39,7 +43,8 @@ D2TsigKey::initStats() { } } -D2TsigKey::~D2TsigKey() { +void +D2TsigKey::removeStats() { StatsMgr& stats_mgr = StatsMgr::instance(); const string& kname = getKeyName().toText(); for (const auto& name : D2Stats::key) { diff --git a/src/lib/d2srv/d2_tsig_key.h b/src/lib/d2srv/d2_tsig_key.h index b5bb6358a1..0101b4b2ef 100644 --- a/src/lib/d2srv/d2_tsig_key.h +++ b/src/lib/d2srv/d2_tsig_key.h @@ -62,6 +62,9 @@ public: private: /// @brief Initialize key statistics. void initStats(); + + /// @brief Remove key statistics. + void removeStats(); }; /// @brief Type of pointer to a D2 TSIG key.