Use enum for perform_update() return code. Made function protected
[bpdyndnsd] / src / service_dhs.cpp
index c757d54..27b9740 100644 (file)
@@ -138,7 +138,7 @@ list<string> ServiceDhs::separate_domain_and_host_part(const string& fqdn) const
  * @param ip IP Address to set.
  * @return 0 if all is fine, -1 otherwise.
  */
-int ServiceDhs::perform_update(const std::string& ip)
+Service::UpdateErrorCode ServiceDhs::perform_update(const std::string& ip)
 {
     string url = BaseUrl;
     url.append(ip);
@@ -161,7 +161,7 @@ int ServiceDhs::perform_update(const std::string& ip)
             if ( boost::regex_search(curl_data,expr_done) )
             {
                 // Update successful
-                return 0;
+                return UpdateOk;
             }
             else
             {
@@ -182,5 +182,6 @@ int ServiceDhs::perform_update(const std::string& ip)
         get_logger()->print_httphelper_not_initialized();
         HTTPHelp->re_initialize();
     }
-    return -1;
+
+    return GenericError;
 }