You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by je...@bull.net on 2001/03/15 11:55:10 UTC

Tomcat IPV6 Test

Just for information....and little question at this end.

I'am testing TOMCAT with java API for IPV6 at the moment and my only 
problem with your product is about 
traitment of number port in request Header which raise an 
NumberFormatException exception ...

Function parseHeaders() in class 
apache/catalina/connector/http/httpProcessor.java which manipulate 
request header http and extract portNumber.
MyURL is using the format for literal IPv6 addresses (described in RFC 
2732).
A literal IPv6 address in a URL is the address enclosed in square brackets 
and 
eatch block is converted to hexadecimal and delimited with colons (eg: 1ffe:00D3:0000:2F3B:02AA:00FF:FE28:00AA)

So my only modification is to convert line (number 531 of source product 
4.0-b1)
int n = value.IndexOf(":");
by
int n = value.lastIndexOf(":"); 
and that's run well....

My question for tomcat's developpers is
do you think this problem can find in other place of your product ?

Thanks for your help.


Jérôme Camilleri
Bull Echirolles

Re: Tomcat IPV6 Test

Posted by Mel Martinez <me...@yahoo.com>.
--- jerome.camilleri@bull.net wrote:
> 
> Function parseHeaders() in class 
> apache/catalina/connector/http/httpProcessor.java
> which manipulate 
> request header http and extract portNumber.
> MyURL is using the format for literal IPv6 addresses
> (described in RFC 
> 2732).
> A literal IPv6 address in a URL is the address
> enclosed in square brackets 
> and 
> eatch block is converted to hexadecimal and
> delimited with colons (eg:
> 1ffe:00D3:0000:2F3B:02AA:00FF:FE28:00AA)
> 
> So my only modification is to convert line (number
> 531 of source product 
> 4.0-b1)
> int n = value.IndexOf(":");
> by
> int n = value.lastIndexOf(":"); 
> and that's run well....
> 

Actually, that might run afoul of the case where there
is no port (i.e., the implicit port 80) in the URL.

The proposed format for IPv6 URLs is to place the
literal address inside [ and ] like so:

http://[1ffe:00D3:0000:2F3B:02AA:00FF:FE28:00AA]:N/path

or

http://[1ffe:00D3:0000:2F3B:02AA:00FF:FE28:00AA]/path

So, the correct way to look for the port in the HOST
header is to parse to the last index of "]" (if any)
and then find the first colon (if any) after that.
I.E. :

int n = value.indexOf(":",value.lastIndexOf("]"));

Note - this should work even if "]" is not found.

> My question for tomcat's developpers is
> do you think this problem can find in other place of
> your product ?
> 

Probably.  This sounds like the kind of area that most
developers are not well setup to test.  It is great
that you've pointed it out so hopefully we can keep it
in mind going forward.

Keep testing!

Cheers,

Mel


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/