luehe       2003/06/05 09:43:42

  Modified:    catalina/src/share/org/apache/catalina Request.java
               catalina/src/share/org/apache/catalina/connector
                        RequestWrapper.java
               catalina/src/share/org/apache/coyote/tomcat5
                        CoyoteRequest.java
  Log:
  Removed setSocket() method from org.apache.catalina.Request, since it
  was never called in any of the classes implementing this interface.
  
  For example, setSocket() was never called on
  org.apache.coyote.tomcat5.CoyoteRequest, causing its getSocket()
  method to always return null, which broke the CertificatesValve, which
  relies on having access to the (SSL)Socket so that it can reinitiate a
  handshake if necessary.
  
  Instead, added setSocket() and getSocket() methods on org.apache.coyote.Request:
  
  - setSocket() is called as part of
    org.apache.coyote.http11.Http11Processor.setSocket(), as follows:
  
      public void setSocket(Socket socket)
          throws IOException {
          this.socket = socket;
          this.request.setSocket(socket); // NEW
      }
  
  - getSocket() is called as part of
    org.apache.coyote.tomcat5.CoyoteRequest.getSocket(), as follows:
  
  diff -u -r1.5 CoyoteRequest.java
  --- CoyoteRequest.java  31 May 2003 15:00:25 -0000      1.5
  +++ CoyoteRequest.java  5 Jun 2003 16:41:17 -0000
  @@ -633,20 +633,7 @@
        * an SSLSocket.
        */
       public Socket getSocket() {
  -        return (socket);
  -    }
  -
  -    /**
  -     * Set the Socket (if any) through which this Request was received.
  -     *
  -     * @param socket The socket through which this request was received
  -     */
  -    public void setSocket(Socket socket) {
  -        this.socket = socket;
  -        remoteHost = null;
  -        remoteAddr = null;
  -        remotePort = -1;
  -        localAddr = null;
  +        return coyoteRequest.getSocket();
       }
  
  Revision  Changes    Path
  1.4       +4 -12     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Request.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Request.java      28 Jan 2003 18:20:05 -0000      1.3
  +++ Request.java      5 Jun 2003 16:43:41 -0000       1.4
  @@ -204,14 +204,6 @@
   
   
       /**
  -     * Set the Socket (if any) through which this Request was received.
  -     *
  -     * @param socket The socket through which this request was received
  -     */
  -    public void setSocket(Socket socket);
  -
  -
  -    /**
        * Return the input stream associated with this Request.
        */
       public InputStream getStream();
  
  
  
  1.2       +4 -16     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/RequestWrapper.java
  
  Index: RequestWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/connector/RequestWrapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestWrapper.java       18 Jul 2002 16:47:57 -0000      1.1
  +++ RequestWrapper.java       5 Jun 2003 16:43:41 -0000       1.2
  @@ -258,18 +258,6 @@
   
   
       /**
  -     * Set the Socket (if any) through which this Request was received.
  -     *
  -     * @param socket The socket through which this request was received
  -     */
  -    public void setSocket(Socket socket) {
  -
  -        request.setSocket(socket);
  -
  -    }
  -
  -
  -    /**
        * Return the input stream associated with this Request.
        */
       public InputStream getStream() {
  
  
  
  1.6       +5 -18     
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CoyoteRequest.java        31 May 2003 15:00:25 -0000      1.5
  +++ CoyoteRequest.java        5 Jun 2003 16:43:41 -0000       1.6
  @@ -633,20 +633,7 @@
        * an SSLSocket.
        */
       public Socket getSocket() {
  -        return (socket);
  -    }
  -
  -    /**
  -     * Set the Socket (if any) through which this Request was received.
  -     *
  -     * @param socket The socket through which this request was received
  -     */
  -    public void setSocket(Socket socket) {
  -        this.socket = socket;
  -        remoteHost = null;
  -        remoteAddr = null;
  -        remotePort = -1;
  -        localAddr = null;
  +        return coyoteRequest.getSocket();
       }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to