set_from_os last to initialize ...

... because it is initialized with values from context itself!
I.e. context->tls_backoff_time, context->tls_connection_retries and context->log are used to initialize upstreams in upstreams_create() called from set_from_os
This commit is contained in:
Willem Toorop 2017-11-28 16:04:23 +01:00
parent 30e440d35c
commit 025f1cdff3
1 changed files with 8 additions and 9 deletions

View File

@ -1574,15 +1574,6 @@ getdns_context_create_with_extended_memory_functions(
result->fchg_resolvconf = NULL;
result->fchg_hosts = NULL;
// resolv.conf does not exist on Windows, handle differently
#ifndef USE_WINSOCK
if ((set_from_os & 1) && (r = set_os_defaults(result)))
goto error;
#else
if ((set_from_os & 1) && (r = set_os_defaults_windows(result)))
goto error;
#endif
result->dnssec_allowed_skew = 0;
result->edns_maximum_udp_payload_size = -1;
if ((r = create_default_dns_transports(result)))
@ -1634,6 +1625,14 @@ getdns_context_create_with_extended_memory_functions(
create_local_hosts(result);
// resolv.conf does not exist on Windows, handle differently
#ifndef USE_WINSOCK
if ((set_from_os & 1) && (r = set_os_defaults(result)))
goto error;
#else
if ((set_from_os & 1) && (r = set_os_defaults_windows(result)))
goto error;
#endif
*context = result;
return GETDNS_RETURN_GOOD;