cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: IDN

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Mon, 26 Apr 2004 16:44:06 +0200

"Daniel Stenberg" <daniel-curl_at_haxx.se> said:

> But I believe this works for you only because your DNS is very liberal. Try
> mine:
>
> $ curl www.tromsø.no -v
> * getaddrinfo(3) failed for www.tromsø.no:80
> * Couldn't resolve host 'www.tromsø.no'
> * Closing connection #0
>
> ... (Curl_resolv() gets this 8bit name passed in and this will be used to the
> resolver which indeed doesn't grok this, I also tried with 'www.hörby.se' but
> with similar result.)

It should be called as:
 rc = Curl_resolv(conn, TRUE_HOSTNAME(conn), conn->port, &hostaddr);
in url.c. Seem your getaddrinfo() gets 'conn->hostname' passed.

> Your patch didn't define TRUE_HOSTNAME, so I added that define in urldata.h
> where ace_hostname is declared.

Ah, forgot that one. I used this in hostip.h at line 204:

/*
 * Return the hostname to resolv.
 */
#ifdef USE_LIBIDN
#define TRUE_HOSTNAME(conn) \
        ((conn)->ace_hostname ? (conn)->ace_hostname : (conn)->hostname)
#else
#define TRUE_HOSTNAME(conn) ((conn)->hostname)
#endif

Your example:

>curl -v www.hörby.se | lynx -stdin
* Couldn't find host www.h÷rby.se in the .netrc file, using defaults
282: ACE name 'www.xn--hrby-5qa.se'
421: not yet
140: dump_addrinfo:
    fam 2, CNAME www.xn--hrby-5qa.se, 217.19.248.132
358: getaddrinfo_thread() status 0, thread retval 0, 366: elapsed 16 ms
* About to connect() to www.h÷rby.se port 80
* Connected to www.h÷rby.se (217.19.248.132) port 80
> GET / HTTP/1.1
User-Agent: curl/7.12.0-CVS (i386-pc-win32) libcurl/7.12.0-CVS OpenSSL/0.9.8 ipv6 zli0.4.3
Host: www.xn--hrby-5qa.se
Pragma: no-cache
Accept: */*
---------------------

                                IDP

                          XN--HRBY-5QA.SE

   This domain name is being held by Safenames for Hörby Kommun

--------------------

works fine here (with UTF-8 doc-charset in Lynx).

--gv
Received on 2004-04-26