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 CoyoteConnector2.java CoyoteRequest.java
Date Sun, 07 Apr 2002 21:11:17 GMT
remm        02/04/07 14:11:17

  Modified:    coyote/src/java/org/apache/coyote/tomcat4
                        CoyoteConnector2.java CoyoteRequest.java
  Log:
  - Implement remoteAddr and remoteHost for the new connector.
  - Use IntrospectionUtils to pass attributes.
  
  Revision  Changes    Path
  1.3       +18 -5     jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java
  
  Index: CoyoteConnector2.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CoyoteConnector2.java	6 Apr 2002 16:53:04 -0000	1.2
  +++ CoyoteConnector2.java	7 Apr 2002 21:11:17 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java,v
1.2 2002/04/06 16:53:04 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/06 16:53:04 $
  + * $Header: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector2.java,v
1.3 2002/04/07 21:11:17 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/07 21:11:17 $
    *
    * ====================================================================
    *
  @@ -80,6 +80,8 @@
   import java.security.UnrecoverableKeyException;
   import java.security.KeyManagementException;
   
  +import org.apache.tomcat.util.IntrospectionUtils;
  +
   import org.apache.coyote.ActionCode;
   import org.apache.coyote.ActionHook;
   import org.apache.coyote.Adapter;
  @@ -110,7 +112,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.2 $ $Date: 2002/04/06 16:53:04 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/07 21:11:17 $
    */
   
   
  @@ -944,7 +946,18 @@
           protocolHandler.setAdapter(adapter);
   
           // Set attributes
  -        protocolHandler.setAttribute("port", "" + port);
  +        IntrospectionUtils.setProperty(protocolHandler, "port", "" + port);
  +        IntrospectionUtils.setProperty(protocolHandler, "maxThreads", 
  +                                       "" + maxProcessors);
  +        IntrospectionUtils.setProperty(protocolHandler, "backlog", 
  +                                       "" + acceptCount);
  +        IntrospectionUtils.setProperty(protocolHandler, "tcpNoDelay", 
  +                                       "" + tcpNoDelay);
  +        IntrospectionUtils.setProperty(protocolHandler, "soTimeout", 
  +                                       "" + connectionTimeout);
  +
  +        // Configure socket factory
  +        // TODO
   
           try {
               protocolHandler.init();
  
  
  
  1.17      +18 -10    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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CoyoteRequest.java	6 Apr 2002 03:06:32 -0000	1.16
  +++ CoyoteRequest.java	7 Apr 2002 21:11:17 -0000	1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
1.16 2002/04/06 03:06:32 remm Exp $
  - * $Revision: 1.16 $
  - * $Date: 2002/04/06 03:06:32 $
  + * $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 $
    *
    * ====================================================================
    *
  @@ -123,7 +123,7 @@
    *
    * @author Remy Maucherat
    * @author Craig R. McClanahan
  - * @version $Revision: 1.16 $ $Date: 2002/04/06 03:06:32 $
  + * @version $Revision: 1.17 $ $Date: 2002/04/07 21:11:17 $
    */
   
   public class CoyoteRequest
  @@ -1016,8 +1016,12 @@
        */
       public String getRemoteAddr() {
           if (remoteAddr == null) {
  -            InetAddress inet = socket.getInetAddress();
  -            remoteAddr = inet.getHostAddress();
  +            if (socket != null) {
  +                InetAddress inet = socket.getInetAddress();
  +                remoteAddr = inet.getHostAddress();
  +            } else {
  +                remoteAddr = coyoteRequest.remoteAddr().toString();
  +            }
           }
           return remoteAddr;
       }
  @@ -1028,11 +1032,15 @@
        */
       public String getRemoteHost() {
           if (remoteHost == null) {
  -            if (connector.getEnableLookups()) {
  -                InetAddress inet = socket.getInetAddress();
  -                remoteHost = inet.getHostName();
  +            if (socket != null) {
  +                if (connector.getEnableLookups()) {
  +                    InetAddress inet = socket.getInetAddress();
  +                    remoteHost = inet.getHostName();
  +                } else {
  +                    remoteHost = getRemoteAddr();
  +                }
               } else {
  -                remoteHost = getRemoteAddr();
  +                remoteHost = coyoteRequest.remoteHost().toString();
               }
           }
           return remoteHost;
  
  
  

--
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