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

Reply via email to