Set last webcheck timestamp early so we don't trash the server in case of an error...
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 14 Oct 2010 09:03:11 +0000 (11:03 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 14 Oct 2010 09:03:11 +0000 (11:03 +0200)
src/ip_addr_helper.cpp

index 8628cb9..429356a 100644 (file)
@@ -409,6 +409,9 @@ string IPAddrHelper::webcheck_ip(bool changed_to_online)
         return "";
     }
 
+    // Set the LastWebcheck time to current time.
+    LastWebcheck = current_time;
+
     // If perform_curl_operation returns a connection problem indicating return code, try the next ip webcheck url if there is one.
     while ( (curl_err_code == 1) && (url_list.size() != 0) && (url_list.front() != "") )
     {
@@ -451,9 +454,6 @@ string IPAddrHelper::webcheck_ip(bool changed_to_online)
         return "";
     }
 
-    // Set the LastWebcheck time to current time.
-    LastWebcheck = current_time;
-
     // If IP is within a private range then return ""
     if ( is_local_ipv4(ip_addr) )
     {