Browse Source

core: don't increment failed dns query counter for reverse dns lookup at startup

- it can happen before counters are intialized, thus check that before
- reported by Hugh Waite, FS#375
Daniel-Constantin Mierla 11 years ago
parent
commit
89c6d73dd5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      dns_cache.c

+ 2 - 1
dns_cache.c

@@ -2599,7 +2599,8 @@ struct hostent* dns_resolvehost(char* name)
 		ret =  _resolvehost(name);
 		if(unlikely(!ret)){
 			/* increment dns error counter */
-			counter_inc(dns_cnts_h.failed_dns_req);
+			if(counters_initialized())
+				counter_inc(dns_cnts_h.failed_dns_req);
 		}
 		return ret;
 	}