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