tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java Http11Protocol.java
Date Tue, 26 Nov 2002 03:32:51 GMT
billbarker    2002/11/25 19:32:51

  Modified:    http11/src/java/org/apache/coyote/http11
                        Http11Processor.java Http11Protocol.java
  Log:
  Adding a flag to disable setting a seperate time-out for uploads.
  
  The effect of this is to have many fewer calls to setSoTimeout.  I've never seen that it
makes much of a difference (at least on Solaris), but it shouldn't cause any problems as long
as you don't plan on doing any big uploads.
  
  Revision  Changes    Path
  1.46      +21 -2     jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
  
  Index: Http11Processor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Http11Processor.java	24 Nov 2002 22:00:04 -0000	1.45
  +++ Http11Processor.java	26 Nov 2002 03:32:50 -0000	1.46
  @@ -238,6 +238,10 @@
        */
       protected int timeout = 300000;   // 5 minutes as in Apache HTTPD server
   
  +    /**
  +     * Flag to disable setting a different time-out on uploads.
  +     */
  +    protected boolean disableUploadTimeout = false;
   
       /**
        * Host name (used to avoid useless B2C conversion on the host name).
  @@ -341,6 +345,19 @@
       }
   
       /**
  +     * Set the flag to control upload time-outs.
  +     */
  +    public void setDisableUploadTimeout(boolean isDisabled) {
  +        disableUploadTimeout = isDisabled;
  +    }
  +    /**
  +     * Get the flag that controls upload time-outs.
  +     */
  +    public boolean getDisableUploadTimeout() {
  +        return disableUploadTimeout;
  +    }
  +
  +    /**
        * Set the upload timeout.
        */
       public void setTimeout( int timeouts ) {
  @@ -380,10 +397,12 @@
           int keepAliveLeft = maxKeepAliveRequests;
           int soTimeout = socket.getSoTimeout();
           boolean keptAlive = false;
  -        socket.setSoTimeout(timeout);
  +        if( !disableUploadTimeout ) {
  +            socket.setSoTimeout(timeout);
  +        }
           while (started && !error && keepAlive) {
               try {
  -                if( keptAlive && soTimeout > 0 ) {
  +                if( !disableUploadTimeout && keptAlive && soTimeout >
0 ) {
                       socket.setSoTimeout(soTimeout);
                   }
                   inputBuffer.parseRequestLine();
  
  
  
  1.17      +6 -0      jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java
  
  Index: Http11Protocol.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Protocol.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Http11Protocol.java	22 Oct 2002 09:23:32 -0000	1.16
  +++ Http11Protocol.java	26 Nov 2002 03:32:50 -0000	1.17
  @@ -185,6 +185,7 @@
       private int	timeout = 300000;	// 5 minutes as in Apache HTTPD server
       private String reportedname;
       private int socketCloseDelay=-1;
  +    private boolean disableUploadTimeout = false;
   
       // -------------------- Pool setup --------------------
   
  @@ -246,6 +247,10 @@
           setAttribute("tcpNoDelay", "" + b);
       }
   
  +    public void setDisableUploadTimeout(boolean isDisabled) {
  +        disableUploadTimeout = isDisabled;
  +    }
  +
       public void setSoLinger( int i ) {
   	ep.setSoLinger( i );
           setAttribute("soLinger", "" + i);
  @@ -346,6 +351,7 @@
               processor.setAdapter( proto.adapter );
               processor.setMaxKeepAliveRequests( proto.maxKeepAliveRequests );
               processor.setTimeout( proto.timeout );
  +            processor.setDisableUploadTimeout( proto.disableUploadTimeout );
   
               //thData[0]=adapter;
               thData[1]=processor;
  
  
  

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