tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteRequest.java
Date Tue, 09 Apr 2002 09:23:13 GMT
remm        02/04/09 02:23:13

  Modified:    coyote/src/java/org/apache/coyote/tomcat4 CoyoteRequest.java
  Log:
  - Use the action to have the protocol handler compute the remote host.
  
  Revision  Changes    Path
  1.18      +12 -11    jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CoyoteRequest.java	7 Apr 2002 21:11:17 -0000	1.17
  +++ CoyoteRequest.java	9 Apr 2002 09:23:12 -0000	1.18
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
1.17 2002/04/07 21:11:17 remm Exp $
  - * $Revision: 1.17 $
  - * $Date: 2002/04/07 21:11:17 $
  + * $Header: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
1.18 2002/04/09 09:23:12 remm Exp $
  + * $Revision: 1.18 $
  + * $Date: 2002/04/09 09:23:12 $
    *
    * ====================================================================
    *
  @@ -98,6 +98,7 @@
   
   import org.apache.tomcat.util.http.Parameters;
   
  +import org.apache.coyote.ActionCode;
   import org.apache.coyote.Request;
   
   import org.apache.catalina.Connector;
  @@ -123,7 +124,7 @@
    *
    * @author Remy Maucherat
    * @author Craig R. McClanahan
  - * @version $Revision: 1.17 $ $Date: 2002/04/07 21:11:17 $
  + * @version $Revision: 1.18 $ $Date: 2002/04/09 09:23:12 $
    */
   
   public class CoyoteRequest
  @@ -1032,14 +1033,14 @@
        */
       public String getRemoteHost() {
           if (remoteHost == null) {
  -            if (socket != null) {
  -                if (connector.getEnableLookups()) {
  -                    InetAddress inet = socket.getInetAddress();
  -                    remoteHost = inet.getHostName();
  -                } else {
  -                    remoteHost = getRemoteAddr();
  -                }
  +            if (connector.getEnableLookups()) {
  +                remoteHost = getRemoteAddr();
  +            } else if (socket != null) {
  +                InetAddress inet = socket.getInetAddress();
  +                remoteHost = inet.getHostName();
               } else {
  +                coyoteRequest.action
  +                    (ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest);
                   remoteHost = coyoteRequest.remoteHost().toString();
               }
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message