Skip to content

Commit

Permalink
Load hosts file on Windows.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ldx committed Mar 21, 2014
1 parent 6a1c4d5 commit a0b247c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions evdns.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit a0b247c

Please sign in to comment.