On Mon, 16 May 2005, Rafael Martinez Torres wrote:
>> Fine for me, or perhaps address_needs_brackets?
>>
>> inline bool address_needs_brackets(const char *host)
>> {
>> return SAFE_INET_ADDR(host,NULL);
>> }
>> ....
>> ....
>
> But this should be then moved into "squid.h" or
> another more appropiate place other than "config.h".
Correct.
> I mean, at
>
> ftp://[2003:80:43ab::2]:90
> http://2003:80:43ab::2
>
> given DNS ip's for the above adresses
>
> ftp://myweb.dns.com:90
> http://myweb.dns.com
>
> ipcache should return 2003:80:43b::2, not two diferent addresses... (I
> have to check ipcache )
DNS lookups is not relevant here. You should NEVER turn a DNS based URL
into a address based one. This only matters when the client sent the URL
in address format to begin with (no DNS name).
What is relevant is that the client will send URLs having brakets around
the IPv6 address component making it a hostname which fits into the URL
scheme. For this situation it makes sense to preserve these brakets when
parsing the URL and then have ipcache deal with them when lookup of IPv6
IP address is needed. This way you do not need to do anything special at
all in the main code, and the only parts who need to care about this
syntax is
1. The URL parsing, to understand that braketed IPv6 addresses is valid
host names (including the brakets).
2. ipcache, to make it possible to extract the IPv6 address from the
braketed form.
Hope I make more sense this time.
There should not be any situation where Squid needs to construct an URL
with an address in braketed form where the address was not braketed in the
URL received by Squid, so you should not need to add brakets which was not
there to start with.
Regards
Henrik
Received on Mon May 16 2005 - 12:08:35 MDT
This archive was generated by hypermail pre-2.1.9 : Tue May 31 2005 - 12:00:03 MDT