[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] HAVE_CARES on Windows
From: |
Gisle Vanem |
Subject: |
[Bug-wget] HAVE_CARES on Windows |
Date: |
Sat, 9 Apr 2016 21:58:18 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
I have tried building latest Wget with '-DHAVE_LIBCARES'
and all resolve attempts failed due to Gnulib's select()
is not compatible with the socket-number(s) returned from
a normal C-ares library on Windows.
This is what I did to fix it:
--- a/host.c 2016-04-09 17:45:44
+++ b/host.c 2016-04-09 21:48:06
@@ -694,6 +694,13 @@
return al;
}
+/* Since GnuLib's select() (i.e. rpl_select()) cannot handle socket-numbers
+ * returned from C-ares, we must use the original select() from Winsock.
+ */
+#ifdef WINDOWS
+#undef select
+#endif
+
static void
wait_ares (ares_channel channel)
{
-----------
So with a command like 'wget --dns-servers=8.8.8.8 www.vg.no'
all is well.
But it seems strange to me that w/o the '--dns-servers' option
it falls back to good old 'gethostbyname_with_timeout_callback()'
method. Shouldn't the use of C-ares's wait_ares() be default w/o
this option? I must be missing something.
--
--gv
- [Bug-wget] HAVE_CARES on Windows,
Gisle Vanem <=