Use enum for perform_update() return code. Made function protected
[bpdyndnsd] / src / service_zoneedit.cpp
index 16381b2..9641011 100644 (file)
@@ -97,9 +97,9 @@ string ServiceZoneedit::assemble_base_url(const string& fqhn) const
 /**
  * Performs the Service update.
  * @param ip IP Address to set.
- * @return 0 if all is fine, -1 otherwise.
+ * @return UpdateOk if all is fine, GenericError otherwise.
  */
-int ServiceZoneedit::perform_update(const std::string& ip)
+Service::UpdateErrorCode ServiceZoneedit::perform_update(const std::string& ip)
 {
     string url = BaseUrl;
     url.append(ip);
@@ -121,7 +121,7 @@ int ServiceZoneedit::perform_update(const std::string& ip)
 
             if ( status_code == "200" )
             {
-                return 0;
+                return UpdateOk;
             }
             else
             {
@@ -142,5 +142,5 @@ int ServiceZoneedit::perform_update(const std::string& ip)
         get_logger()->print_httphelper_not_initialized();
         HTTPHelp->re_initialize();
     }
-    return -1;
+    return GenericError;
 }