X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=src%2Fupdater.cpp;h=28a58fe59a53dae0c770871cfe36ff41d75c1362;hb=7335d7a7a9db007b02b47c30cc76148a9962e993;hp=712200d9a07d659500dff1457456bf47254d7c08;hpb=b6171a3f35e5d3bbb89f8ccc44b58d2514a2c795;p=bpdyndnsd diff --git a/src/updater.cpp b/src/updater.cpp index 712200d..28a58fe 100644 --- a/src/updater.cpp +++ b/src/updater.cpp @@ -255,7 +255,8 @@ void Updater::update_services(bool changed_to_online) const 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() ) + // If DNS-Record was not found but service was not activated, the hostname could be deactivated, offline or not existent. In this case try a ordinary update. + if ( ip_dns_recheck.empty() && service->get_activated() ) { Log->print_dns_lookup_failed(changed_to_online, hostname); continue; @@ -273,7 +274,16 @@ void Updater::update_services(bool changed_to_online) const if ( ip_last_update != ip_host ) { // Update - Log->print_update_service(hostname, ip_dns_recheck, ip_last_update, ip_host, lastupdated); + if ( !ip_dns_recheck.empty() ) + { + Log->print_update_service(hostname, ip_dns_recheck, ip_last_update, ip_host, lastupdated); + } + else + { + // Service gets updated the first time and no DNS-Record was found. This is either a initial update or the hostname is really not available. + Log->print_update_service(hostname, "", ip_last_update, ip_host, lastupdated); + } + service->update(ip_host, current_time, changed_to_online); } else