From a7c1e2710320cbab3fd0ddc536943bd8fa11d986 Mon Sep 17 00:00:00 2001 From: Bjoern Sikora Date: Mon, 12 Oct 2009 13:18:42 +0200 Subject: [PATCH] Don't try to update if dynamic hostname could not be found. Changed log level for "Host not found" to warning (doesn't lead to program exit). --- src/logger.cpp | 2 +- src/updater.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/logger.cpp b/src/logger.cpp index 59113e0..91d040d 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -823,7 +823,7 @@ void Logger::print_error_hostname_to_ip(const string& exception, const string& h { ostringstream msg; msg << "Could not resolve the hostname: " << hostname << " to an IP-Address: " << exception << endl; - log_error(msg.str(),level); + log_warning(msg.str(),level); } } diff --git a/src/updater.cpp b/src/updater.cpp index 3961d77..54306b4 100644 --- a/src/updater.cpp +++ b/src/updater.cpp @@ -246,8 +246,13 @@ void Updater::update_services() Log->print_cached_dns_entry(hostname, ip_dns_recheck, ip_last_update, ip_host); + // Test if the DNS-Record could not be found. + if ( ip_dns_recheck.empty() ) + { + // Next in BOOST_FOREACH + } // Test if the actual DNS-Record differs from the host's IP. - if ( ip_host != ip_dns_recheck ) + else if ( ip_host != ip_dns_recheck ) { // Check if the service will be updated for the first time. if ( lastupdated == 0 ) -- 1.7.1