tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1042706 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/coyote/http11/ webapps/docs/config/
Date Mon, 06 Dec 2010 16:26:17 GMT
Author: markt
Date: Mon Dec  6 16:26:17 2010
New Revision: 1042706

URL: http://svn.apache.org/viewvc?rev=1042706&view=rev
Log:
Fix mix-up of connectionUploadTimeout and connectionTimeout
Use connectionUploadTimeout consistently as attribute name
Document connectionUploadTimeout

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Connector.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
    tomcat/trunk/webapps/docs/config/http.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Mon Dec  6 16:26:17 2010
@@ -247,7 +247,6 @@ public class Connector extends Lifecycle
          replacements.put("acceptCount", "backlog");
          replacements.put("connectionLinger", "soLinger");
          replacements.put("connectionTimeout", "soTimeout");
-         replacements.put("connectionUploadTimeout", "timeout");
          replacements.put("randomFile", "randomfile");
          replacements.put("rootFile", "rootfile");
          replacements.put("sslProtocols", "protocols");

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Mon Dec  6 16:26:17
2010
@@ -181,7 +181,7 @@ public abstract class AbstractHttp11Proc
     /**
      * Maximum timeout on uploads. 5 minutes as in Apache HTTPD server.
      */
-    protected int timeout = 300000;
+    protected int connectionUploadTimeout = 300000;
 
 
     /**
@@ -582,15 +582,15 @@ public abstract class AbstractHttp11Proc
     /**
      * Set the upload timeout.
      */
-    public void setTimeout( int timeouts ) {
-        timeout = timeouts ;
+    public void setConnectionUploadTimeout(int timeout) {
+        connectionUploadTimeout = timeout ;
     }
 
     /**
      * Get the upload timeout.
      */
-    public int getTimeout() {
-        return timeout;
+    public int getConnectionUploadTimeout() {
+        return connectionUploadTimeout;
     }
 
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Mon Dec  6 16:26:17
2010
@@ -152,14 +152,6 @@ public abstract class AbstractHttp11Prot
         return endpoint.getKeepAliveTimeout();
     }
 
-    public int getTimeout() {
-        return getSoTimeout();
-    }
-
-    public void setTimeout( int timeout ) {
-        setSoTimeout(timeout);
-    }
-    
     public int getConnectionTimeout() {
         return getSoTimeout();
     }
@@ -198,14 +190,27 @@ public abstract class AbstractHttp11Prot
     public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; }
 
     
+    /**
+     * Specifies a different (usually  longer) connection timeout during data
+     * upload. 
+     */
+    private int connectionUploadTimeout = 300000;
+    public int getConnectionUploadTimeout() { return connectionUploadTimeout; }
+    public void setConnectionUploadTimeout(int i) {
+        connectionUploadTimeout = i;
+    }
+
+
     // HTTP
     /**
-     * If true, the regular socket timeout will be used for the full duration
-     * of the connection.
+     * If true, the connectionUploadTimeout will be ignored and the regular
+     * socket timeout will be used for the full duration of the connection.
      */
     private boolean disableUploadTimeout = true;
     public boolean getDisableUploadTimeout() { return disableUploadTimeout; }
-    public void setDisableUploadTimeout(boolean isDisabled) { disableUploadTimeout = isDisabled;
}
+    public void setDisableUploadTimeout(boolean isDisabled) {
+        disableUploadTimeout = isDisabled;
+    }
     
     
     // HTTP

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Mon Dec  6 16:26:17
2010
@@ -238,7 +238,8 @@ public class Http11AprProcessor extends 
                 request.setStartTime(System.currentTimeMillis());
                 keptAlive = true;
                 if (!disableUploadTimeout) {
-                    Socket.timeoutSet(socketRef, timeout * 1000);
+                    Socket.timeoutSet(socketRef,
+                            connectionUploadTimeout * 1000);
                 }
                 inputBuffer.parseHeaders();
             } catch (IOException e) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Dec  6 16:26:17
2010
@@ -143,19 +143,6 @@ public class Http11AprProtocol extends A
     public boolean getDeferAccept() { return ((AprEndpoint)endpoint).getDeferAccept(); }
     public void setDeferAccept(boolean deferAccept) { ((AprEndpoint)endpoint).setDeferAccept(deferAccept);
}
 
-    /**
-     * This timeout represents the socket timeout which will be used while
-     * the adapter execution is in progress, unless disableUploadTimeout
-     * is set to true. The default is the same as for Apache HTTP Server
-     * (300 000 milliseconds).
-     * TODO: Make the timeout attribute names consistent across the connectors
-     */
-    protected int timeout = 300000;
-    @Override
-    public int getTimeout() { return timeout; }
-    @Override
-    public void setTimeout(int timeout) { this.timeout = timeout; }
-
     // --------------------  SSL related properties --------------------
 
     /**
@@ -437,7 +424,8 @@ public class Http11AprProtocol extends A
                     proto.getMaxTrailerSize());
             processor.setAdapter(proto.adapter);
             processor.setMaxKeepAliveRequests(proto.getMaxKeepAliveRequests());
-            processor.setTimeout(proto.timeout);
+            processor.setConnectionUploadTimeout(
+                    proto.getConnectionUploadTimeout());
             processor.setDisableUploadTimeout(proto.getDisableUploadTimeout());
             processor.setCompressionMinSize(proto.getCompressionMinSize());
             processor.setCompression(proto.getCompression());

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Mon Dec  6 16:26:17
2010
@@ -339,7 +339,8 @@ public class Http11NioProcessor extends 
                 }
                 request.setStartTime(System.currentTimeMillis());
                 if (!disableUploadTimeout) { //only for body, not for request headers
-                    socket.getIOChannel().socket().setSoTimeout(timeout);
+                    socket.getIOChannel().socket().setSoTimeout(
+                            connectionUploadTimeout);
                 }
             } catch (IOException e) {
                 if (log.isDebugEnabled()) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Mon Dec  6 16:26:17
2010
@@ -427,7 +427,8 @@ public class Http11NioProtocol extends A
                     proto.getMaxTrailerSize());
             processor.setAdapter(proto.adapter);
             processor.setMaxKeepAliveRequests(proto.getMaxKeepAliveRequests());
-            processor.setTimeout(proto.getTimeout());
+            processor.setConnectionUploadTimeout(
+                    proto.getConnectionUploadTimeout());
             processor.setDisableUploadTimeout(proto.getDisableUploadTimeout());
             processor.setCompressionMinSize(proto.getCompressionMinSize());
             processor.setCompression(proto.getCompression());

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Mon Dec  6 16:26:17 2010
@@ -199,7 +199,7 @@ public class Http11Processor extends Abs
                 if (disableUploadTimeout) {
                     socket.getSocket().setSoTimeout(soTimeout);
                 } else {
-                    socket.getSocket().setSoTimeout(timeout);
+                    socket.getSocket().setSoTimeout(connectionUploadTimeout);
                 }
                 inputBuffer.parseHeaders();
             } catch (IOException e) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Mon Dec  6 16:26:17 2010
@@ -299,7 +299,8 @@ public class Http11Protocol extends Abst
             processor.setAdapter(proto.adapter);
             processor.setMaxKeepAliveRequests(proto.getMaxKeepAliveRequests());
             processor.setKeepAliveTimeout(proto.getKeepAliveTimeout());
-            processor.setTimeout(proto.getTimeout());
+            processor.setConnectionUploadTimeout(
+                    proto.getConnectionUploadTimeout());
             processor.setDisableUploadTimeout(proto.getDisableUploadTimeout());
             processor.setCompressionMinSize(proto.getCompressionMinSize());
             processor.setCompression(proto.getCompression());

Modified: tomcat/trunk/webapps/docs/config/http.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1042706&r1=1042705&r2=1042706&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Mon Dec  6 16:26:17 2010
@@ -300,12 +300,18 @@
       presented.  The default value is 60000 (i.e. 60 seconds).</p>
     </attribute>
     
+    <attribute name="connectionUploadTimeout" required="false">
+      <p>Specifies the timeout, in milliseconds, to use while a data upload is
+      in progress. The only takes effect if
+      <strong>disableUploadTimeout</strong> is set to <code>false</code>.
+      </p>
+    </attribute>
+
     <attribute name="disableUploadTimeout" required="false">
-      <p>This flag allows the servlet container to use a different, longer
-      connection timeout while a servlet is being executed, which in the end
-      allows either the servlet a longer amount of time to complete its
-      execution, or a longer timeout during data upload. If not specified,
-      this attribute is set to "true".</p>
+      <p>This flag allows the servlet container to use a different, usually
+      longer connection timeout during data upload. If not specified, this
+      attribute is set to <code>true</code> which disables this longer timeout.
+      </p>
     </attribute>
 
     <attribute name="executor" required="false">



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


Mime
View raw message