aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-08-21 21:09:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-08-21 21:09:44 +0000
commit0c37ab52553c1c7640d0a45dafadb718791a9c6f (patch)
tree181ee1f4f4ae4ae75c2b83e5835bbd4a18c7260a
parent747a05844d66e070dbee9a2ad93695480ab07237 (diff)
Alfredo Tupone provided a fix for the Windows code in get_iphlpapi_dns_info()
when getting the DNS server etc.
-rw-r--r--ares/CHANGES5
-rw-r--r--ares/ares_init.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ares/CHANGES b/ares/CHANGES
index 164224918..52e2d9dab 100644
--- a/ares/CHANGES
+++ b/ares/CHANGES
@@ -1,5 +1,10 @@
Changelog for the c-ares project
+* August 21
+
+- Alfredo Tupone provided a fix for the Windows code in get_iphlpapi_dns_info()
+ when getting the DNS server etc.
+
* June 19
- Added some checks for the addrinfo structure.
diff --git a/ares/ares_init.c b/ares/ares_init.c
index b78c9279c..f97f70157 100644
--- a/ares/ares_init.c
+++ b/ares/ares_init.c
@@ -327,6 +327,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
size_t ip_size = sizeof("255.255.255.255,")-1;
size_t left = ret_size;
char *ret = ret_buf;
+ HRESULT res;
if (!fi)
return (0);
@@ -339,7 +340,8 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
if (!GetNetworkParams)
goto quit;
- if ((*GetNetworkParams) (fi, &size) != ERROR_BUFFER_OVERFLOW)
+ res = (*GetNetworkParams) (fi, &size);
+ if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
goto quit;
fi = alloca (size);