Protocols.DNS.client() not functional on Windows
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3992
Reported by Anders Johansson anders@roxen.com
All syncronous operations with Protocols.DNS.client is broken on windows. The following program only returns the expected result from the second part when using the async_client (which by the way is undocumented). This was tested on both Windows 2000 and 2003.
void got_result(string from, string to, mixed ... extra)
{
werror("Got result: %O, %O, %O\n", from, to, extra);
}
int main()
{
Protocols.DNS.client con = Protocols.DNS.client();
werror("Host: %O\n", con->gethostbyname("wwww.roxen.com"));
werror("MX: %O\n", con->get_primary_mx("roxen.com"));
werror("Sync: %O\n", con->do_sync_query(con->mkquery("pike.ida.liu.se",
Protocols.DNS.C_IN,
Protocols.DNS.T_A)));
Protocols.DNS.async_client dns = Protocols.DNS.async_client();
dns->host_to_ip("www.roxen.com", got_result);
dns->get_mx("roxen.com", got_result);
return -17;
}
When using Stdio.UDP directly this is the result:
C:\pike\pike\7.4.326\bin>pike
Pike v7.4 release 326 running Hilfe v3.5 (Incremental Pike Frontend)
> object udp = Stdio.UDP();
> string s =Protocols.DNS.protocol()->mkquery("www.roxen.com",
Protocols.DNS.C_IN, Protocols.DNS.T_A);
> udp->bind(0);
(1) Result: Stdio.UDP()
> udp->send("212.247.28.2", 53, s);
(2) Result: 31
> udp->wait(5);
udp->wait(): select() failed with errno 10038
Stdio.UDP: Stdio.UDP()->wait(5)
HilfeInput:1: HilfeInput()->___HilfeWrapper()