From: Gerd von Egidy Date: Thu, 12 Jun 2014 15:38:05 +0000 (+0200) Subject: correctly parse responses from changeip.com (dyndns protocol) X-Git-Tag: v1.1~5 X-Git-Url: http://developer.intra2net.com/git/?p=bpdyndnsd;a=commitdiff_plain;h=777fb85c2458b4a6bef33edec4b48bd798564679 correctly parse responses from changeip.com (dyndns protocol) --- diff --git a/src/service_dyndns.cpp b/src/service_dyndns.cpp index 475d29e..1b6dc53 100644 --- a/src/service_dyndns.cpp +++ b/src/service_dyndns.cpp @@ -125,7 +125,8 @@ Service::UpdateErrorCode ServiceDyndns::perform_update(const std::string& ip) // Get the received http data. string curl_data = HTTPHelp->get_curl_data(); - if ( curl_data.compare(0,4,"good") == 0 ) + if ( curl_data.compare(0,4,"good") == 0 || // dyndns.org answer + curl_data.compare(0,21,"200 Successful Update") == 0) // changeip.com answer { return UpdateOk; } @@ -154,6 +155,12 @@ Service::UpdateErrorCode ServiceDyndns::perform_update(const std::string& ip) return UpdateError; } } + else if ( http_status_code == 401 ) + { + // auth error as indicated by changeip.com + get_logger()->print_service_not_authorized(url,get_login(),get_password()); + return NotAuth; + } else { get_logger()->print_update_failure(url,http_status_code);