From: Vilmos Nebehaj Date: Fri, 21 Mar 2014 13:36:15 +0000 (+0100) Subject: Load hosts file on Windows. X-Git-Tag: release-2.1.5-beta~35^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0b247cdc0cfff55c7966fc99ce62bd6cfe2c309;p=libevent Load hosts file on Windows. Hosts files are not loaded in evdns_base_config_windows_nameservers() if load_nameservers_with_getnetworkparams() succeeds on Windows. Parse and load it first before setting up nameservers. --- diff --git a/evdns.c b/evdns.c index 59c3abe1..a143074d 100644 --- a/evdns.c +++ b/evdns.c @@ -3826,17 +3826,18 @@ evdns_base_config_windows_nameservers(struct evdns_base *base) if (base == NULL) return -1; EVDNS_LOCK(base); + fname = evdns_get_default_hosts_filename(); + log(EVDNS_LOG_DEBUG, "Loading hosts entries from %s", fname); + evdns_base_load_hosts(base, fname); + if (fname) + mm_free(fname); + if (load_nameservers_with_getnetworkparams(base) == 0) { EVDNS_UNLOCK(base); return 0; } r = load_nameservers_from_registry(base); - fname = evdns_get_default_hosts_filename(); - evdns_base_load_hosts(base, fname); - if (fname) - mm_free(fname); - EVDNS_UNLOCK(base); return r; }