mmanders 01/10/03 15:13:45
Modified: src/share/org/apache/tomcat/modules/server
Http10Interceptor.java
Log:
Fix Bug #3944 request.getRemoteAddr() alays returning 127.0.0.1
Bug report from Alessandro Polverini
Since the base Request object set remoteAddr and remoteHost to defaults,
the checks around setting them off of the real request always succeed so the
real values are never used. Added calls to recycle these in the constructor.
This still allows for delayed setting, since the calls to set the values can be
expensive.
Revision Changes Path
1.26 +4 -0
jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java
Index: Http10Interceptor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- Http10Interceptor.java 2001/09/22 22:05:31 1.25
+++ Http10Interceptor.java 2001/10/03 22:13:45 1.26
@@ -209,6 +209,10 @@
public HttpRequest() {
super();
+
+ // recycle these to remove the defaults
+ remoteAddrMB.recycle();
+ remoteHostMB.recycle();
}
public Object getAttribute(String name) {
if (name.equals("javax.servlet.request.X509Certificate")) {