Allow the localPort to be overridden for a request
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 May 2011 10:29:06 +0000 (10:29 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 May 2011 10:29:06 +0000 (10:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1100944 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/Request.java
java/org/apache/catalina/valves/RemoteIpValve.java

index ff6283f..5ae0226 100644 (file)
@@ -834,6 +834,15 @@ public class Request
 
 
     /**
+     * Set the port number of the server to process this request.
+     *
+     * @param port The server port
+     */
+    public void setLocalPort(int port) {
+        localPort = port;
+    }
+
+    /**
      * Bind an object to a specified name in the internal notes associated
      * with this request, replacing any existing binding for this name.
      *
index bbb6195..6fb329b 100644 (file)
@@ -708,7 +708,7 @@ public class RemoteIpValve extends ValveBase {
         }
         request.setServerPort(port);
         if (changeLocalPort) {
-            request.getCoyoteRequest().setLocalPort(port);
+            request.setLocalPort(port);
         }
     }