Don't try to update if dynamic hostname could not be found.
authorBjoern Sikora <bjoern.sikora@intra2net.com>
Mon, 12 Oct 2009 11:18:42 +0000 (13:18 +0200)
committerBjoern Sikora <bjoern.sikora@intra2net.com>
Mon, 12 Oct 2009 11:18:42 +0000 (13:18 +0200)
Changed log level for "Host not found" to warning (doesn't lead to program exit).

src/logger.cpp
src/updater.cpp

index 59113e0..91d040d 100644 (file)
@@ -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);
     }
 }
 
index 3961d77..54306b4 100644 (file)
@@ -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 )