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 Fri, 11 May 2001 22:37:26 GMT
marcsaeg    01/05/11 15:37:26

  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:
  getRemoteHost() now does DNS lookups (if necessary) to determine the
  remote host name based on the client's IP address.
  
  PR: 208
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.52.2.10 +10 -2     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.9
  retrieving revision 1.52.2.10
  diff -u -r1.52.2.9 -r1.52.2.10
  --- RequestImpl.java	2001/05/07 16:24:34	1.52.2.9
  +++ RequestImpl.java	2001/05/11 22:37:21	1.52.2.10
  @@ -813,9 +813,17 @@
       }
   
       public String getRemoteHost() {
  -        // This is belt and suspenders.  The request adapters should have set this correctly.
  -        if(remoteHost == null || remoteHost.length() == 0)
  +        // AJP12 defaults to empty string, AJP13 defaults to null
  +        if(remoteHost != null && remoteHost.length() != 0)
  +            return remoteHost;
  +
  +        try{
  +            remoteHost = InetAddress.getByName(remoteAddr).getHostName();
  +        }catch(Exception e){
  +            // If anything went wrong then fall back to using the remote hosts IP address
               remoteHost = remoteAddr;
  +        }
  +
           return remoteHost;
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.4  +0 -2      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.3
  retrieving revision 1.28.2.4
  diff -u -r1.28.2.3 -r1.28.2.4
  --- Ajp12ConnectionHandler.java	2001/05/07 16:24:40	1.28.2.3
  +++ Ajp12ConnectionHandler.java	2001/05/11 22:37:23	1.28.2.4
  @@ -271,8 +271,6 @@
   		    if( doLog ) log("AJP: RA=" + remoteAddr );
   		    
   		    remoteHost = ajpin.readString("");            //remote host
  -            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
  
  
  
  1.5.2.7   +3 -5      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.6
  retrieving revision 1.5.2.7
  diff -u -r1.5.2.6 -r1.5.2.7
  --- Ajp13ConnectorRequest.java	2001/05/07 16:24:42	1.5.2.6
  +++ Ajp13ConnectorRequest.java	2001/05/11 22:37:24	1.5.2.7
  @@ -1,7 +1,7 @@
   /*
  - * $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 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp13ConnectorRequest.java,v
1.5.2.7 2001/05/11 22:37:24 marcsaeg Exp $
  + * $Revision: 1.5.2.7 $
  + * $Date: 2001/05/11 22:37:24 $
    *
    * ====================================================================
    *
  @@ -144,8 +144,6 @@
           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