From dbb6abcbcb75430155ab700d39bdf0c94c9d96ae Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Mon, 31 Jan 2011 14:57:07 +0100 Subject: [PATCH] Dyndns protocol: Mark "nochg" and "abuse" return code as successful update. Needed by the burnt IP logic. --- src/service_dyndns.cpp | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/service_dyndns.cpp b/src/service_dyndns.cpp index 7a53a74..0939d84 100644 --- a/src/service_dyndns.cpp +++ b/src/service_dyndns.cpp @@ -125,13 +125,22 @@ int ServiceDyndns::perform_update(const std::string& ip) // Get the received http data. string curl_data = HTTPHelp->get_curl_data(); - // Note: We don't handle "nochg" as this shouldn't happen - // if only one client is active. - if ( curl_data.compare(0,4,"good") == 0 ) { return 0; } + 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; + } + 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; + } else if ( curl_data == "badauth" ) { get_logger()->print_service_not_authorized(url,get_login(),get_password()); -- 1.7.1