Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
89c6d73dd5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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;
 	}