mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +00:00
[ADNS][DNSAPI] Fix a local resolving regression that led to some browsers crashing after startup. By Peter Hater. CORE-12072 CORE-12088
svn path=/trunk/; revision=72898
This commit is contained in:
parent
1c4750792d
commit
2a4fd5b529
|
@ -771,6 +771,12 @@ DnsQuery_W(LPCWSTR Name,
|
|||
}
|
||||
|
||||
adns_error = adns_init(&astate, adns_if_noenv | adns_if_noerrprint | adns_if_noserverwarn, 0);
|
||||
if (adns_error != adns_s_ok)
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName);
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, network_info);
|
||||
return DnsIntTranslateAdnsToDNS_STATUS(adns_error);
|
||||
}
|
||||
for (pip = &(network_info->DnsServerList); pip; pip = pip->Next)
|
||||
{
|
||||
addr.s_addr = inet_addr(pip->IpAddress.String);
|
||||
|
@ -783,12 +789,6 @@ DnsQuery_W(LPCWSTR Name,
|
|||
}
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, network_info);
|
||||
|
||||
if (adns_error != adns_s_ok)
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName);
|
||||
return DnsIntTranslateAdnsToDNS_STATUS(adns_error);
|
||||
}
|
||||
|
||||
if (Servers)
|
||||
{
|
||||
for (i = 0; i < Servers->AddrCount; i++)
|
||||
|
|
7
reactos/sdk/lib/3rdparty/adns/src/setup.c
vendored
7
reactos/sdk/lib/3rdparty/adns/src/setup.c
vendored
|
@ -521,17 +521,18 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
|
|||
}
|
||||
|
||||
static int init_finish(adns_state ads) {
|
||||
struct in_addr ia;
|
||||
struct protoent *proto;
|
||||
int r;
|
||||
|
||||
/* Don't add loopback on ReactOS it slows down queries to non existent server */
|
||||
#ifndef __REACTOS__
|
||||
struct in_addr ia;
|
||||
if (!ads->nservers) {
|
||||
if (ads->diagfile && ads->iflags & adns_if_debug)
|
||||
fprintf(ads->diagfile,"adns: no nameservers, using localhost\n");
|
||||
ia.s_addr= htonl(INADDR_LOOPBACK);
|
||||
addserver(ads,ia);
|
||||
}
|
||||
|
||||
#endif
|
||||
proto= getprotobyname("udp"); if (!proto) { r= ENOPROTOOPT; goto x_free; }
|
||||
ADNS_CLEAR_ERRNO;
|
||||
ads->udpsocket= socket(AF_INET,SOCK_DGRAM,proto->p_proto);
|
||||
|
|
Loading…
Reference in a new issue