Переглянути джерело

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

(cherry picked from commit 89c6d73dd51eb9b96f50d3f04219612fa7725224)
Daniel-Constantin Mierla 11 роки тому
батько
коміт
a3169d02d7
1 змінених файлів з 2 додано та 1 видалено
  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;
 	}