From f5ee9bc575646b096e0c35421acc36e91e1e5a29 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Wed, 6 Oct 2010 15:22:49 +0200 Subject: [PATCH] Remove almost redundant update code --- src/logger.cpp | 18 ------------------ src/logger.hpp | 2 -- src/updater.cpp | 11 ----------- 3 files changed, 0 insertions(+), 31 deletions(-) diff --git a/src/logger.cpp b/src/logger.cpp index cc507c0..e94822a 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1667,24 +1667,6 @@ void Logger::print_cached_dns_entry(const string& hostname, const string& ip_dns /** - * Updating service for the first time. - * @param hostname Hostname - * @param ip_dns_recheck Cached DNS entry - * @param ip_host Hosts IP - */ -void Logger::print_update_service_firttime(const string& hostname, const string& ip_dns_recheck, const string& ip_host) const -{ - int level = 1; - if ( level <= Loglevel ) - { - ostringstream msg; - msg << "Updating service for the first time. Hostname: " << hostname << " DNS-Record: " << ip_dns_recheck << " Hosts IP: " << ip_host << endl; - log_notice(msg.str()); - } -} - - -/** * Updating service * @param hostname Hostname * @param ip_dns_recheck Cached DNS entry diff --git a/src/logger.hpp b/src/logger.hpp index d3c82ec..9c95b8e 100644 --- a/src/logger.hpp +++ b/src/logger.hpp @@ -246,8 +246,6 @@ public: void print_cached_dns_entry(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host) const; - void print_update_service_firttime(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_host) const; - void print_update_service(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host, const time_t lastupdated) const; void print_update_service_ttl_expired(const std::string& hostname, const std::string& ip_dns_recheck, const std::string& ip_last_update, const std::string& ip_host, const time_t lastupdated, const int dns_cache_ttl, const time_t current_time) const; diff --git a/src/updater.cpp b/src/updater.cpp index be6d29a..07881f4 100644 --- a/src/updater.cpp +++ b/src/updater.cpp @@ -259,17 +259,6 @@ void Updater::update_services() const continue; } - // Check if the service will be updated for the first time. - if ( lastupdated == 0 ) - { - // Update for the firt time. - Log->print_update_service_firttime(hostname, ip_dns_recheck, ip_host); - service->update(ip_host,current_time); - - // Update done, go to next service - continue; - } - // We already have updated, check if the IP set in last update differs from the actual host's ip. if ( ip_last_update != ip_host ) { -- 1.7.1