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 Constants.java CoyoteConnector.java
Date Mon, 28 Apr 2003 17:21:17 GMT
remm        2003/04/28 10:21:17

  Modified:    coyote/src/java/org/apache/coyote/tomcat4 Tag: coyote_10
                        Constants.java CoyoteConnector.java
  Log:
  - Port patch (expose new timeout parameters), submitted partially by
    Michael Yates <yatesmi at nortelnetworks.com>.
  - Tab fixes.
  - Remove imports.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.2   +2 -0      jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/Constants.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- Constants.java	9 Feb 2003 22:30:02 -0000	1.4.2.1
  +++ Constants.java	28 Apr 2003 17:21:16 -0000	1.4.2.2
  @@ -74,6 +74,8 @@
       public static final String Package = "org.apache.coyote.tomcat4";
       public static final int DEFAULT_CONNECTION_LINGER = -1;
       public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
  +    public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
  +    public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
   
       public static final int PROCESSOR_IDLE = 0;
       public static final int PROCESSOR_ACTIVE = 1;
  
  
  
  1.20.2.2  +98 -60    jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteConnector.java,v
  retrieving revision 1.20.2.1
  retrieving revision 1.20.2.2
  diff -u -r1.20.2.1 -r1.20.2.2
  --- CoyoteConnector.java	9 Feb 2003 22:30:02 -0000	1.20.2.1
  +++ CoyoteConnector.java	28 Apr 2003 17:21:16 -0000	1.20.2.2
  @@ -65,36 +65,15 @@
   package org.apache.coyote.tomcat4;
   
   
  -import java.io.IOException;
  -import java.net.InetAddress;
  -import java.net.ServerSocket;
  -import java.net.Socket;
  -import java.net.UnknownHostException;
  -import java.security.AccessControlException;
  -import java.util.Stack;
   import java.util.Vector;
  -import java.util.Enumeration;
  -import java.security.KeyStoreException;
  -import java.security.NoSuchAlgorithmException;
  -import java.security.cert.CertificateException;
  -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;
  -import org.apache.coyote.InputBuffer;
  -import org.apache.coyote.OutputBuffer;
   import org.apache.coyote.ProtocolHandler;
   
   import org.apache.catalina.Connector;
   import org.apache.catalina.Container;
  -import org.apache.catalina.HttpRequest;
  -import org.apache.catalina.HttpResponse;
   import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
  @@ -115,7 +94,6 @@
    * @version $Revision$ $Date$
    */
   
  -
   public final class CoyoteConnector
       implements Connector, Lifecycle {
   
  @@ -224,6 +202,21 @@
   
   
       /**
  +     * Timeout value on the incoming connection during request processing.
  +     * Note : a value of 0 means no timeout.
  +     */
  +    private int connectionUploadTimeout = 
  +        Constants.DEFAULT_CONNECTION_UPLOAD_TIMEOUT;
  +
  +
  +    /**
  +     * Timeout value on the server socket.
  +     * Note : a value of 0 means no timeout.
  +     */
  +    private int serverSocketTimeout = Constants.DEFAULT_SERVER_SOCKET_TIMEOUT;
  +
  +
  +    /**
        * The port number on which we listen for requests.
        */
       private int port = 8080;
  @@ -328,7 +321,7 @@
        * Coyote Protocol handler class name.
        * Defaults to the Coyote HTTP/1.1 protocolHandler.
        */
  -    private String protocolHandlerClassName = 
  +    private String protocolHandlerClassName =
           "org.apache.coyote.http11.Http11Protocol";
   
   
  @@ -420,6 +413,50 @@
   
   
       /**
  +     * Return the connection upload timeout for this Connector.
  +     */
  +    public int getConnectionUploadTimeout() {
  +
  +        return (connectionUploadTimeout);
  +
  +    }
  +
  +
  +    /**
  +     * Set the connection upload timeout for this Connector.
  +     *
  +     * @param connectionUploadTimeout The new connection upload timeout
  +     */
  +    public void setConnectionUploadTimeout(int connectionUploadTimeout) {
  +
  +        this.connectionUploadTimeout = connectionUploadTimeout;
  +
  +    }
  +
  +
  +    /**
  +     * Return the server socket timeout for this Connector.
  +     */
  +    public int getServerSocketTimeout() {
  +
  +        return (serverSocketTimeout);
  +
  +    }
  +
  +
  +    /**
  +     * Set the server socket timeout for this Connector.
  +     *
  +     * @param connectionUploadTimeout The new server socket timeout
  +     */
  +    public void setServerSocketTimeout(int serverSocketTimeout) {
  +
  +        this.serverSocketTimeout = serverSocketTimeout;
  +
  +    }
  +
  +
  +    /**
        * Return the accept count for this Connector.
        */
       public int getAcceptCount() {
  @@ -531,7 +568,7 @@
   
       /**
        * Set the value of compression.
  -     * 
  +     *
        * @param compression The new compression value, which can be "on", "off"
        * or "force"
        */
  @@ -710,9 +747,9 @@
   
   
       /**
  -     * Set the class name of the Coyote protocol handler which will be used 
  +     * Set the class name of the Coyote protocol handler which will be used
        * by the connector.
  -     * 
  +     *
        * @param protocolHandlerClassName The new class name
        */
       public void setProtocolHandlerClassName(String protocolHandlerClassName) {
  @@ -803,8 +840,8 @@
       /**
        * Set the flag to specify upload time-out behavior.
        *
  -     * @param isDisabled If <code>true</code>, then the <code>timeout</code>

  -     * parameter is ignored.  If <code>false</code>, then the 
  +     * @param isDisabled If <code>true</code>, then the <code>timeout</code>
  +     * parameter is ignored.  If <code>false</code>, then the
        * <code>timeout</code> parameter is used to control uploads.
        */
       public void setDisableUploadTimeout( boolean isDisabled ) {
  @@ -908,7 +945,7 @@
   
       /**
        * Set the value of the Uri validation flag.
  -     * 
  +     *
        * @param useURIValidationHack The new flag value
        */
       public void setUseURIValidationHack(boolean useURIValidationHack) {
  @@ -1003,7 +1040,7 @@
   
   
       /**
  -     * Get the lifecycle listeners associated with this lifecycle. If this 
  +     * Get the lifecycle listeners associated with this lifecycle. If this
        * Lifecycle has no listeners registered, a zero-length array is returned.
        */
       public LifecycleListener[] findLifecycleListeners() {
  @@ -1032,7 +1069,7 @@
           throws LifecycleException {
   
           if (initialized)
  -            throw new LifecycleException 
  +            throw new LifecycleException
                   (sm.getString("coyoteConnector.alreadyInitialized"));
   
           this.initialized = true;
  @@ -1052,64 +1089,66 @@
           }
           protocolHandler.setAdapter(adapter);
   
  -        IntrospectionUtils.setProperty(protocolHandler, "jkHome", 
  +        IntrospectionUtils.setProperty(protocolHandler, "jkHome",
                                          System.getProperty("catalina.base"));
   
           // Set attributes
           IntrospectionUtils.setProperty(protocolHandler, "port", "" + port);
  -        IntrospectionUtils.setProperty(protocolHandler, "maxThreads", 
  +        IntrospectionUtils.setProperty(protocolHandler, "maxThreads",
                                          "" + maxProcessors);
  -        IntrospectionUtils.setProperty(protocolHandler, "backlog", 
  +        IntrospectionUtils.setProperty(protocolHandler, "backlog",
                                          "" + acceptCount);
  -        IntrospectionUtils.setProperty(protocolHandler, "tcpNoDelay", 
  +        IntrospectionUtils.setProperty(protocolHandler, "tcpNoDelay",
                                          "" + tcpNoDelay);
           IntrospectionUtils.setProperty(protocolHandler, "soLinger",
                                          "" + connectionLinger);
  -        IntrospectionUtils.setProperty(protocolHandler, "soTimeout", 
  +        IntrospectionUtils.setProperty(protocolHandler, "soTimeout",
                                          "" + connectionTimeout);
  -        IntrospectionUtils.setProperty(protocolHandler, "timeout", 
  -                                       "" + connectionTimeout);
  -        IntrospectionUtils.setProperty(protocolHandler, "disableUploadTimeout", 
  +        IntrospectionUtils.setProperty(protocolHandler, "timeout",
  +                                       "" + connectionUploadTimeout);
  +        IntrospectionUtils.setProperty(protocolHandler, "serverSoTimeout",
  +                                       "" + serverSocketTimeout);
  +        IntrospectionUtils.setProperty(protocolHandler, "disableUploadTimeout",
                                          "" + disableUploadTimeout);
           IntrospectionUtils.setProperty(protocolHandler, "maxKeepAliveRequests",
                                          "" + maxKeepAliveRequests);
  -        IntrospectionUtils.setProperty(protocolHandler, "compression", 
  +        IntrospectionUtils.setProperty(protocolHandler, "compression",
                                          compression);
           if (address != null) {
  -            IntrospectionUtils.setProperty(protocolHandler, "address", 
  +            IntrospectionUtils.setProperty(protocolHandler, "address",
                                              address);
           }
   
           // Configure secure socket factory
           if (factory instanceof CoyoteServerSocketFactory) {
  -            IntrospectionUtils.setProperty(protocolHandler, "secure", 
  +            IntrospectionUtils.setProperty(protocolHandler, "secure",
                                              "" + true);
  -            CoyoteServerSocketFactory ssf = 
  +            CoyoteServerSocketFactory ssf =
                   (CoyoteServerSocketFactory) factory;
  -            IntrospectionUtils.setProperty(protocolHandler, "algorithm", 
  +            IntrospectionUtils.setProperty(protocolHandler, "algorithm",
                                              ssf.getAlgorithm());
               if (ssf.getClientAuth()) {
  -                IntrospectionUtils.setProperty(protocolHandler, "clientauth", 
  +                IntrospectionUtils.setProperty(protocolHandler, "clientauth",
                                                  "" + ssf.getClientAuth());
               }
  -            IntrospectionUtils.setProperty(protocolHandler, "keystore", 
  +            IntrospectionUtils.setProperty(protocolHandler, "keystore",
                                              ssf.getKeystoreFile());
  -            IntrospectionUtils.setProperty(protocolHandler, "randomfile", 
  +            IntrospectionUtils.setProperty(protocolHandler, "randomfile",
                                              ssf.getRandomFile());
  -            IntrospectionUtils.setProperty(protocolHandler, "rootfile", 
  +            IntrospectionUtils.setProperty(protocolHandler, "rootfile",
                                              ssf.getRootFile());
  -			
  -            IntrospectionUtils.setProperty(protocolHandler, "keypass", 
  +
  +            IntrospectionUtils.setProperty(protocolHandler, "keypass",
                                              ssf.getKeystorePass());
  -            IntrospectionUtils.setProperty(protocolHandler, "keytype", 
  +            IntrospectionUtils.setProperty(protocolHandler, "keytype",
                                              ssf.getKeystoreType());
  -            IntrospectionUtils.setProperty(protocolHandler, "protocol", 
  +            IntrospectionUtils.setProperty(protocolHandler, "protocol",
                                              ssf.getProtocol());
  -            IntrospectionUtils.setProperty(protocolHandler, 
  -                                           "sSLImplementation", 
  +            IntrospectionUtils.setProperty(protocolHandler,
  +                                           "sSLImplementation",
                                              ssf.getSSLImplementation());
           } else {
  -            IntrospectionUtils.setProperty(protocolHandler, "secure", 
  +            IntrospectionUtils.setProperty(protocolHandler, "secure",
                                              "" + false);
           }
   
  @@ -1171,6 +1210,5 @@
           }
   
       }
  -
   
   }
  
  
  

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


Mime
View raw message