tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: svn commit: r757470 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/coyote/ajp/ java/org/apache/jk/common/ webapps/docs/
Date Mon, 23 Mar 2009 22:53:54 GMT
On 23.03.2009 19:31, Mladen Turk wrote:
> wrote:
>> Author: rjung
>> Date: Mon Mar 23 17:54:41 2009
>> New Revision: 757470
>> URL:
>> Log:
>> Set remote port for AJP connectors from the optional request
>> attribute AJP_REMOTE_PORT.
>> Backport of r756926 and r757223.
> Now when thinking of that we should probably fix the AJP13
> remote_addr field and instead just passing connection->remote_ip,
> do something like:
> sprintf(remote_addr, "%s:%d", connection->remote_ip,
> get_port_of(connection->remote_addr))
> In the AJP13 protocol spec nothing says that remote_addr
> MUST be IP address, neither that it MUST be IPV4 address.
> IMO till now we wrongly passed just the IP part of the
> "remote_addr" instead the full address containing port as well.
> I read the "remote_addr" as a string that can recreate
> the FULL remote address on the container side.

We need to change JK and TC in a way, that old versions of each work 
together compatibly with new version.

Unfortunately all existing versions of Tomcat put the forwarded AJP 
"remote_addr" straight into the request objects remoteAddr, which is 
returned by the servlet APIs standard getRemoteAddr(). And that's 
required to return a string representation of an IP address.

Changing the forwarded data to include IP and port, would break this 
requirement and change the behaviour of all existing Tomcat versions.

Maybe I miss something, but I think the workaround chosen in the commit 
is safer.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message