Fix 'occurred' typo
[bpdyndnsd] / src / service_easydns.cpp
index 89d9a4e..d598d64 100644 (file)
@@ -36,7 +36,7 @@ ServiceEasydns::ServiceEasydns()
 ServiceEasydns::ServiceEasydns(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, const string& _proxy, const int _proxy_port)
 {
     if ( _update_interval == -1 )        // If _update_interval is default po::option_desc (not specified via config)
-        set_update_interval(10);              // use default protocol value
+        set_update_interval(12);              // use default protocol value
     else
         set_update_interval(_update_interval);
 
@@ -183,7 +183,7 @@ list<string> ServiceEasydns::separate_domain_and_host_part(const string& fqdn) c
  * @param ip IP Address to set.
  * @return 0 if all is fine, -1 otherwise.
  */
-int ServiceEasydns::perform_update(const std::string& ip)
+Service::UpdateErrorCode ServiceEasydns::perform_update(const std::string& ip)
 {
     string url = BaseUrl;
     url.append(ip);
@@ -205,15 +205,17 @@ int ServiceEasydns::perform_update(const std::string& ip)
 
             if ( status_code == "NOERROR" )
             {
-                return 0;
+                return UpdateOk;
             }
             else if ( status_code == "NOACCESS" )
             {
                 get_logger()->print_service_not_authorized(url,get_login(),get_password());
+                return NotAuth;
             }
             else
             {
                 get_logger()->print_update_failure(url, curl_data);
+                return UpdateError;
             }
         }
         else
@@ -226,5 +228,6 @@ int ServiceEasydns::perform_update(const std::string& ip)
         get_logger()->print_httphelper_not_initialized();
         HTTPHelp->re_initialize();
     }
-    return -1;
+
+    return GenericError;
 }