tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marcs...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/connector Ajp12ConnectionHandler.java Ajp13ConnectorRequest.java
Date Mon, 07 May 2001 16:24:47 GMT
marcsaeg    01/05/07 09:24:46

  Modified:    src/share/org/apache/tomcat/core Tag: tomcat_32
                        RequestImpl.java
               src/share/org/apache/tomcat/service/connector Tag: tomcat_32
                        Ajp12ConnectionHandler.java
                        Ajp13ConnectorRequest.java
  Log:
  The implementation of ServletRequest.getRemoteHost() was not spec compliant.
  In cases where the host is not known (e.g. AJP12 and AJP13) the returned
  value was either an empty string or a null.  These are both wrong.  The spec
  says that getRemoteHost() return the remote IP address if the host is not
  known.
  
  PR: 208
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.52.2.9  +4 -1      jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/RequestImpl.java
  
  Index: RequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/RequestImpl.java,v
  retrieving revision 1.52.2.8
  retrieving revision 1.52.2.9
  diff -u -r1.52.2.8 -r1.52.2.9
  --- RequestImpl.java	2001/04/17 10:43:52	1.52.2.8
  +++ RequestImpl.java	2001/05/07 16:24:34	1.52.2.9
  @@ -813,7 +813,10 @@
       }
   
       public String getRemoteHost() {
  -	return remoteHost;
  +        // This is belt and suspenders.  The request adapters should have set this correctly.
  +        if(remoteHost == null || remoteHost.length() == 0)
  +            remoteHost = remoteAddr;
  +        return remoteHost;
       }
   
       /** Fill in the buffer. This method is probably easier to implement than
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.3  +3 -1      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp12ConnectionHandler.java
  
  Index: Ajp12ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp12ConnectionHandler.java,v
  retrieving revision 1.28.2.2
  retrieving revision 1.28.2.3
  diff -u -r1.28.2.2 -r1.28.2.3
  --- Ajp12ConnectionHandler.java	2000/11/10 06:42:51	1.28.2.2
  +++ Ajp12ConnectionHandler.java	2001/05/07 16:24:40	1.28.2.3
  @@ -271,7 +271,9 @@
   		    if( doLog ) log("AJP: RA=" + remoteAddr );
   		    
   		    remoteHost = ajpin.readString("");            //remote host
  -		    if( doLog ) log("AJP: RH=" + remoteHost );
  +            if(remoteHost.length() == 0)
  +                remoteHost = remoteAddr;     // If host isn't specified then use IP address

  +            if( doLog ) log("AJP: RH=" + remoteHost );
   		    
   		    remoteUser = ajpin.readString(null);                 //remote user
   		    if( doLog ) log("AJP: RU=" + remoteUser);
  
  
  
  1.5.2.6   +5 -3      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp13ConnectorRequest.java
  
  Index: Ajp13ConnectorRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp13ConnectorRequest.java,v
  retrieving revision 1.5.2.5
  retrieving revision 1.5.2.6
  diff -u -r1.5.2.5 -r1.5.2.6
  --- Ajp13ConnectorRequest.java	2001/02/14 22:19:55	1.5.2.5
  +++ Ajp13ConnectorRequest.java	2001/05/07 16:24:42	1.5.2.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp13ConnectorRequest.java,v
1.5.2.5 2001/02/14 22:19:55 danmil Exp $
  - * $Revision: 1.5.2.5 $
  - * $Date: 2001/02/14 22:19:55 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp13ConnectorRequest.java,v
1.5.2.6 2001/05/07 16:24:42 marcsaeg Exp $
  + * $Revision: 1.5.2.6 $
  + * $Date: 2001/05/07 16:24:42 $
    *
    * ====================================================================
    *
  @@ -144,6 +144,8 @@
           requestURI = msg.getString();
           remoteAddr = msg.getString();
           remoteHost = msg.getString();
  +        if(remoteHost == null)      //If we don't have a host then use the IP address
  +            remoteHost = remoteAddr;
           serverName = msg.getString();
           serverPort = msg.getInt();
           bsc        = msg.getByte();
  
  
  

Mime
View raw message