Use enum for perform_update() return code. Made function protected
[bpdyndnsd] / src / service_easydns.cpp
index 89d9a4e..161822c 100644 (file)
@@ -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,7 +205,7 @@ int ServiceEasydns::perform_update(const std::string& ip)
 
             if ( status_code == "NOERROR" )
             {
-                return 0;
+                return UpdateOk;
             }
             else if ( status_code == "NOACCESS" )
             {
@@ -226,5 +226,6 @@ int ServiceEasydns::perform_update(const std::string& ip)
         get_logger()->print_httphelper_not_initialized();
         HTTPHelp->re_initialize();
     }
-    return -1;
+
+    return GenericError;
 }