* @param ip IP Address to set.
* @return 0 if all is fine, -1 otherwise.
*/
-int ServiceDyndns::perform_update(const std::string& ip)
+Service::UpdateErrorCode ServiceDyndns::perform_update(const std::string& ip)
{
string url = BaseUrl;
url.append(ip);
{
get_logger()->print_httphelper_not_initialized();
HTTPHelp->re_initialize();
- return -1;
+ return GenericError;
}
// Perform curl operation on given url
if ( curl_data.compare(0,4,"good") == 0 )
{
- return 0;
+ return UpdateOk;
}
else if (curl_data.compare(0,5,"nochg") == 0 )
{
// IP didn't change, this might indicate a problem at the
// dyndns backend or another client is running elsewhere.
- return 0;
+ get_logger()->print_update_failure(url, curl_data);
+ return UpdateOk;
}
else if (curl_data.compare(0,5,"abuse") == 0 )
{
// Account is blocked. Log it as a successful update
// so the IP address will be "burnt" until it changes.
- return 0;
+ get_logger()->print_update_failure(url, curl_data);
+ return UpdateOk;
}
else if ( curl_data == "badauth" )
{
get_logger()->print_update_failure(url,http_status_code);
}
- return -1;
+ return GenericError;
}