From 4e691eb07de42c57a02b9edb30795d5fffbbadf1 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Fri, 19 Jun 2015 15:19:46 +0200 Subject: [PATCH] moved 3 lines of Cname constructors from dnscache.cpp to cname.h (why would anybody search for Cname code in dnscache.cpp?) --- src/dns/cname.h | 9 ++++++--- src/dns/dnscache.cpp | 20 +------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/dns/cname.h b/src/dns/cname.h index 7f301be..883dc51 100644 --- a/src/dns/cname.h +++ b/src/dns/cname.h @@ -39,9 +39,12 @@ struct Cname std::string Host; TimeToLive Ttl; - Cname(); - Cname(const std::string &host, const uint32_t ttl); - Cname(const std::string &host, const TimeToLive &ttl); + Cname() {} + Cname(const std::string &host, const uint32_t ttl) + : Host(host), Ttl( TimeToLive(ttl) ) {} + + Cname(const std::string &host, const TimeToLive &ttl) + : Host(host), Ttl(ttl) {} // serialization friend class boost::serialization::access; diff --git a/src/dns/dnscache.cpp b/src/dns/dnscache.cpp index a0c2a1a..118f802 100644 --- a/src/dns/dnscache.cpp +++ b/src/dns/dnscache.cpp @@ -47,27 +47,9 @@ namespace Config { const int SAVE_TIMER_SECONDS = 60; const int CACHE_TIME_WARP_THRESH_HOURS = 24; + const int CACHE_REMOVE_OUTDATED_DAYS = 60; } -// ----------------------------------------------------------------------------- -// Cname -// ----------------------------------------------------------------------------- - -Cname::Cname() - : Host() - , Ttl() -{} - -Cname::Cname(const std::string &host, const uint32_t ttl) - : Host( host ) - , Ttl( ttl ) -{} - -Cname::Cname(const std::string &host, const TimeToLive &ttl) - : Host( host ) - , Ttl( ttl ) -{} - // ----------------------------------------------------------------------------- // DNS Cache constructor / destructor -- 1.7.1