remm        2004/01/22 10:27:04

  Modified:    catalina/src/share/org/apache/coyote/tomcat5
                        CoyoteConnector.java mbeans-descriptors.xml
  Log:
  - Allow configuring the header size (for most use cases, it was too big, and since
    it represents 75% of the memory allocated by Tomcat).
  - New default size: 4 KB (the whole HTTP header must fit inside that, for both
    the request and the response).
  - Allocations of these buffers can't be dynamic: there are too many references
    lying around, and this guarantees leaks. The only safe way to reallocate the
    buffers if to get rid of the processor.
  - Note: In Tomcat 4.1.30, I'll integrate the same connectors as in 5.0.18, to
    avoid possible problems.
  
  Revision  Changes    Path
  1.36      +23 -1     
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java
  
  Index: CoyoteConnector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteConnector.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- CoyoteConnector.java      10 Jan 2004 20:39:50 -0000      1.35
  +++ CoyoteConnector.java      22 Jan 2004 18:27:04 -0000      1.36
  @@ -301,6 +301,12 @@
   
   
       /**
  +     * Maximum size of a HTTP header. 4KB is the default.
  +     */
  +    private int maxHttpHeaderSize = 4 * 1024;
  +
  +
  +    /**
        * Maximum number of Keep-Alive requests to honor per connection.
        */
       private int maxKeepAliveRequests = 100;
  @@ -1041,6 +1047,21 @@
       }
   
       /**
  +     * Return the maximum HTTP header size.
  +     */
  +    public int getMaxHttpHeaderSize() {
  +        return maxHttpHeaderSize;
  +    }
  +
  +    /**
  +     * Set the maximum HTTP header size.
  +     */
  +    public void setMaxHttpHeaderSize(int size) {
  +        maxHttpHeaderSize = size;
  +        setProperty("maxHttpHeaderSize", String.valueOf(size));
  +    }
  +
  +    /**
        * Return the maximum number of Keep-Alive requests to honor 
        * per connection.
        */
  @@ -1055,6 +1076,7 @@
           maxKeepAliveRequests = mkar;
           setProperty("maxKeepAliveRequests", String.valueOf(mkar));
       }
  +
   
       /**
        * Return the scheme that will be assigned to requests received
  
  
  
  1.13      +4 -0      
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml
  
  Index: mbeans-descriptors.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/mbeans-descriptors.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- mbeans-descriptors.xml    10 Jan 2004 20:39:50 -0000      1.12
  +++ mbeans-descriptors.xml    22 Jan 2004 18:27:04 -0000      1.13
  @@ -85,6 +85,10 @@
             description="Alias name of this connector's keypair and supporting 
certificate chain"
                    type="java.lang.String"/>
   
  +    <attribute   name="maxHttpHeaderSize"
  +          description="Maximum size in bytes of the HTTP header"
  +                 type="int"/>
  +
       <attribute   name="maxKeepAliveRequests"
             description="Maximum number of Keep-Alive requests to honor per 
connection"
                    type="int"/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to