You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@locus.apache.org on 2000/04/30 23:32:08 UTC

cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test HttpConnector.java HttpProcessor.java

craigmcc    00/04/30 14:32:08

  Modified:    proposals/catalina/src/share/org/apache/tomcat/connector/test
                        HttpConnector.java HttpProcessor.java
  Log:
  Implement configurable input buffering on the HTTP input stream.  Defaults to 2048 bytes,
  but can be configured by setting the "bufferSize" parameter on the <Connector> element.
  
  (Output buffering is provided by the response implementation itself, also defaulting to
  2048 bytes but configurable by the servlet itself.)
  
  Revision  Changes    Path
  1.5       +38 -10    jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpConnector.java
  
  Index: HttpConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpConnector.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HttpConnector.java	2000/04/27 05:55:14	1.4
  +++ HttpConnector.java	2000/04/30 21:32:07	1.5
  @@ -1,13 +1,13 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpConnector.java,v 1.4 2000/04/27 05:55:14 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/04/27 05:55:14 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpConnector.java,v 1.5 2000/04/30 21:32:07 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/04/30 21:32:07 $
    *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -15,7 +15,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -23,15 +23,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  + *    from this software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache"
  @@ -59,7 +59,7 @@
    *
    * [Additional notices, if required by prior licensing conditions]
    *
  - */ 
  + */
   
   
   package org.apache.tomcat.connector.test;
  @@ -92,7 +92,7 @@
    * purposes.  Not intended to be the final solution.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/04/27 05:55:14 $
  + * @version $Revision: 1.5 $ $Date: 2000/04/30 21:32:07 $
    */
   
   
  @@ -118,6 +118,12 @@
   
   
       /**
  +     * The input buffer size we should create on input streams.
  +     */
  +    private int bufferSize = 2048;
  +
  +
  +    /**
        * The set of processors that have ever been created.
        */
       private Vector created = new Vector();
  @@ -263,6 +269,28 @@
       public boolean isAvailable() {
   
   	return (started);
  +
  +    }
  +
  +
  +    /**
  +     * Return the input buffer size for this Connector.
  +     */
  +    public int getBufferSize() {
  +
  +	return (this.bufferSize);
  +
  +    }
  +
  +
  +    /**
  +     * Set the input buffer size for this Connector.
  +     *
  +     * @param bufferSize The new input buffer size.
  +     */
  +    public void setBufferSize(int bufferSize) {
  +
  +	this.bufferSize = bufferSize;
   
       }
   
  
  
  
  1.4       +13 -11    jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpProcessor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HttpProcessor.java	2000/04/26 02:14:49	1.3
  +++ HttpProcessor.java	2000/04/30 21:32:07	1.4
  @@ -1,13 +1,13 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpProcessor.java,v 1.3 2000/04/26 02:14:49 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/26 02:14:49 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/connector/test/HttpProcessor.java,v 1.4 2000/04/30 21:32:07 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/30 21:32:07 $
    *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -15,7 +15,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -23,15 +23,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  + *    from this software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache"
  @@ -59,12 +59,13 @@
    *
    * [Additional notices, if required by prior licensing conditions]
    *
  - */ 
  + */
   
   
   package org.apache.tomcat.connector.test;
   
   
  +import java.io.BufferedInputStream;
   import java.io.InputStream;
   import java.io.IOException;
   import java.io.OutputStream;
  @@ -97,7 +98,7 @@
    * the request.  When the processor is completed, it will recycle itself.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/26 02:14:49 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/30 21:32:07 $
    */
   
   final class HttpProcessor
  @@ -457,7 +458,8 @@
   
   	// Construct and initialize the objects we will need
   	try {
  -	    input = socket.getInputStream();
  +	    input = new BufferedInputStream(socket.getInputStream(),
  +	    				    connector.getBufferSize());
   	    request.setStream(input);
   	    request.setResponse(response);
   	    output = socket.getOutputStream();