Dyndns protocol: Mark "nochg" and "abuse" return code as successful update. Needed...
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 31 Jan 2011 13:57:07 +0000 (14:57 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 31 Jan 2011 13:57:07 +0000 (14:57 +0100)
src/service_dyndns.cpp

index 7a53a74..0939d84 100644 (file)
@@ -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());