Use enum for perform_update() return code. Made function protected
[bpdyndnsd] / src / service_tzo.cpp
index f21c674..402ff44 100644 (file)
@@ -105,7 +105,7 @@ string ServiceTzo::assemble_base_url(const string& fqhn, const string& username,
  * @param ip IP Address to set.
  * @return 0 if all is fine, -1 otherwise.
  */
-int ServiceTzo::perform_update(const std::string& ip)
+Service::UpdateErrorCode ServiceTzo::perform_update(const std::string& ip)
 {
     string url = BaseUrl;
     url.append(ip);
@@ -127,7 +127,7 @@ int ServiceTzo::perform_update(const std::string& ip)
 
             if ( status_code == "200" )
             {
-                return 0;
+                return UpdateOk;
             }
             else if ( status_code == "401" )
             {
@@ -148,5 +148,6 @@ int ServiceTzo::perform_update(const std::string& ip)
         get_logger()->print_httphelper_not_initialized();
         HTTPHelp->re_initialize();
     }
-    return -1;
+
+    return GenericError;
 }