tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Date Mon, 06 Jun 2011 16:52:07 GMT
On 06/06/2011 06:54, Konstantin Kolinko wrote:
> 2011/6/6 Mark Thomas <markt@apache.org>:
>> On 05/06/2011 17:47, Rainer Jung wrote:
>>>>>> +            for (int i = valueL - 1; i > colonPos; i--) {
>>>>>> +                int charValue = HexUtils.getDec(valueB[i + valueS]);
>>>>>
>>>>> Any idea, why hex digits (including a-f, A-F) are allowed in port numbers?
> 
> Probably that was just to do not invent a separate method.
> Another way to fix this would be to replace the next line
>                 if (charValue == -1) {
> with
>                 if (charValue == -1 || charValue > 9) {

<snip/>

> Regarding the patch,
> http://svn.apache.org/viewvc?rev=1132487&view=rev
> 
> Code looks OK but my small concern is that the invalid case is handled
> with a NumberFormatException here and it can be triggered by an
> external request. I have not tested it here, but general notion is
> that exception creation is expensive.
> 
> Maybe we can use a cached copy of NumberFormatException, like
> o.a.naming.resources.ImmutableNameNotFoundException

I think reverting to the original code and using the change you
suggested above is a better solution. I'll do that shortly.

> By the way, there are two HexUtils classes in trunk. Do we need both?

I'll take a look and remove one if I can. Thanks for spotting it.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message