tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeanfrancois Arcand <jfarc...@apache.org>
Subject Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java
Date Mon, 01 Dec 2003 22:06:36 GMT


Remy Maucherat wrote:

> Jeanfrancois Arcand wrote:
>
>> Remy Maucherat wrote:
>>
>>> jfarcand@apache.org wrote:
>>>
>>>> jfarcand    2003/12/01 12:44:14
>>>>
>>>> Modified:    http11/src/java/org/apache/coyote/http11 
>>>> Http11Processor.java Log: Use the socket info instead of hardcoded
>>>> value. HttpServletRequest.getLocalPort() is currently broken if the
>>>> port are not the default one.
>>>
>>>
>>> This looks wrong. I am almost certain this was on purpose. These 
>>> must return the default value for the protocol, not the values 
>>> actually used by the socket.
>>
>>
>> Humm. Then maybe the way HttpServletRequest.getLocalPort() is 
>> implemented is wrong. Can socket.getLocalPort() returns something 
>> different that 80 if the connector supposed to  listen on 80 (maybe 
>> I'm missing something from the jk side here....)
>
>
> I don't remember. I think you should look into the version history. I 
> will tomorrow.

It was added with version 1.23.  Bill ? ;-)

I've just realized that the sslSupport variable is no longer needed (so 
my fix needs to be cleaned).  BTW the test I'm doing is:

telnet localhost 8080
GET /tomcat-test/ServletTest HTTP/1.1
Host: localhost

In the servlet, I'm doing request.getLocalPort(), which always returns 
80. But it works if I do

telnet localhost 8080
GET /tomcat-test/ServletTest HTTP/1.1
Host: localhost:8080

;-)

-- Jeanfrancois

>
>> Also we are doing something similar if http 1.0 is used (just above):
>>
>>>             // HTTP/1.0
>>>             // Default is what the socket tells us. Overriden if a 
>>> host is
>>>             // found/parsed
>>>             request.setServerPort(socket.getLocalPort());
>>
>
> It goes both ways. One possible explanation for that is that this code 
> is much less used, and it never got fixed.
>
> Remy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


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


Mime
View raw message