Dyndns: Better handling for nochg and abuse return codes: Log them as unsuccessful...
[bpdyndnsd] / src / service.cpp
index 1bab19b..3eebff0 100644 (file)
@@ -280,7 +280,9 @@ void Service::update(const string& ip, const time_t current_time, bool changed_t
     {
         Log->print_update_service(service_name);
 
-        if ( perform_update(ip) == UpdateOk )
+        UpdateErrorCode update_res = perform_update(ip);
+
+        if (update_res == UpdateOk)
         {
             // if update was successful, we need to set the Lastupdated and ActualIP base member.
             set_last_update(current_time,ip);
@@ -292,6 +294,13 @@ void Service::update(const string& ip, const time_t current_time, bool changed_t
         }
         else
         {
+            if (update_res == NoChange || update_res == Blocked)
+            {
+                // Log update for burnt IP logic and update "ActualIP" of this service
+                set_last_update(current_time,ip);
+                ActualIP = ip;
+            }
+
             // problem while trying to update service
             Log->print_update_service_failure(service_name);