Don't update the same IP more than 2 times in success.
[bpdyndnsd] / src / service_ods.cpp
index 8f69f8c..ba6df98 100644 (file)
@@ -28,7 +28,7 @@ ServiceOds::ServiceOds()
  * @param _login The login name.
  * @param _password The corresponding password.
  */
-ServiceOds::ServiceOds(const string& _protocol, const string& _hostname, const string& _login, const string& _password, const Logger::Ptr& _logger, const int _update_interval, const int _max_updates_within_interval, const int _dns_cache_ttl)
+ServiceOds::ServiceOds(const string& _protocol, const string& _hostname, const string& _login, const string& _password, const Logger::Ptr& _logger, const int _update_interval, const int _max_updates_within_interval, const int _max_equal_updates_in_succession, const int _dns_cache_ttl)
     : UpdateServer("update.ods.org")
     , Port("7071")
 {
@@ -42,6 +42,11 @@ ServiceOds::ServiceOds(const string& _protocol, const string& _hostname, const s
     else
         set_max_updates_within_interval(_max_updates_within_interval);
 
+    if ( _max_equal_updates_in_succession == -1 )
+        set_max_equal_updates_in_succession(2);
+    else
+        set_max_equal_updates_in_succession(_max_equal_updates_in_succession);
+
     if ( _dns_cache_ttl == -1 )
         set_dns_cache_ttl(180);
     else