support for internationalized domain names in srv, too

This commit is contained in:
Philipp Hancke 2011-08-03 10:20:35 +02:00 committed by psyc://psyced.org/~lynX
parent 46963f7768
commit 7897992f05

View File

@ -614,6 +614,13 @@ void dns_srv_resolve(string hostname, string service, string proto, closure call
// dumme bevormundung. wegen der musste ich jetzt ewig lang suchen:
//unless (proto == "tcp" || proto == "udp") return;
// da wir mit nem String arbeiten muessen
#ifdef __IDNA__
if (catch(hostname = idna_to_ascii(TO_UTF8(hostname)); nolog)) {
P0(("catch: punycode %O in %O\n", hostname, ME))
return;
}
#endif
req = sprintf("_%s._%s.%s", service, proto, hostname);
rc = send_erq(ERQ_LOOKUP_SRV, req, lambda(({ 'wu }),
({ (#',),