Author: akhaldi
Date: Tue Oct 4 07:55:15 2016
New Revision: 72898
URL:
http://svn.reactos.org/svn/reactos?rev=72898&view=rev
Log:
[ADNS][DNSAPI] Fix a local resolving regression that led to some browsers crashing after
startup. By Peter Hater. CORE-12072 CORE-12088
Modified:
trunk/reactos/dll/win32/dnsapi/dnsapi/query.c
trunk/reactos/sdk/lib/3rdparty/adns/src/setup.c
Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/qu…
==============================================================================
--- trunk/reactos/dll/win32/dnsapi/dnsapi/query.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/dnsapi/dnsapi/query.c [iso-8859-1] Tue Oct 4 07:55:15 2016
@@ -771,6 +771,12 @@
}
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);
@@ -782,12 +788,6 @@
adns_ccf_search(astate, "LOCALDOMAIN", -1,
network_info->DomainName);
}
RtlFreeHeap(RtlGetProcessHeap(), 0, network_info);
-
- if (adns_error != adns_s_ok)
- {
- RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName);
- return DnsIntTranslateAdnsToDNS_STATUS(adns_error);
- }
if (Servers)
{
Modified: trunk/reactos/sdk/lib/3rdparty/adns/src/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/3rdparty/adns/src/…
==============================================================================
--- trunk/reactos/sdk/lib/3rdparty/adns/src/setup.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/3rdparty/adns/src/setup.c [iso-8859-1] Tue Oct 4 07:55:15 2016
@@ -521,17 +521,18 @@
}
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);