On 23.03.2009 19:31, Mladen Turk wrote:
rj...@apache.org wrote:
Author: rjung
Date: Mon Mar 23 17:54:41 2009
New Revision: 757470
URL: http://svn.apache.org/viewvc?rev=757470&view=rev
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.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org