cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: libcurl and IDNA

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 7 Apr 2004 15:38:28 +0200 (CEST)

On Wed, 7 Apr 2004, Gisle Vanem wrote:

> Ah, I forgot I had "195.159.151.136 www.tromsų.no" in my hosts file. 'curl
> http://195.159.151.136' and 'curl http://www.xn--troms-zuA.no' should give
> different pages.

Yeps, I tried 'curl http://195.159.151.136 -H 'Host: www.tromsų.no' and it
seemed to confuse the server (based on the message the server responds with).
;-)

> I agree. I need to identify those places where domain-name should be
> converted to/from ACE form. AFAICS most is done in CreateConnection().
> Is conn->gname the only place a domain-name is stored?

Yes.

> And does conn->hostname always points to conn->gname[] ?

Yes. It always points to somewhere within conn->gname[].

We should rename and cleanup the use of the 'name', 'gname' and 'hostname'
fields. gname[] is basicly the buffer storage area, while 'name' and
'hostname' are pointers within that area and both are used in a mixed fashion
when a pointer to the host name is wanted.

> If so, it would probably be easiest to do:

> rc = idna_to_ascii_lz (conn->gname, &conn->hostname, 0);
>
> and then when conn->hostname != conn->gname assume it's ACE encoded.

It might be useful to store the original input host name as well as the newly
ACE converted one, if nothing else so for info/debug purposes.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-04-07