You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2001/04/23 21:00:27 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime BodyContentImpl.java

marcsaeg    01/04/23 12:00:26

  Modified:    src/share/org/apache/jasper/runtime Tag: tomcat_32
                        BodyContentImpl.java
  Log:
  Fixing buffer size calculation.  The last commit attempted to improve
  performace by doubling the buffer size when reallocating.  Unfortunately
  I messed up applying the patch and got the bufferSize variable out of
  sync with the actual size of the buffer.
  
  PR:  1271
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.6.4   +4 -3      jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java
  
  Index: BodyContentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java,v
  retrieving revision 1.6.6.3
  retrieving revision 1.6.6.4
  diff -u -r1.6.6.3 -r1.6.6.4
  --- BodyContentImpl.java	2001/03/09 23:31:54	1.6.6.3
  +++ BodyContentImpl.java	2001/04/23 19:00:20	1.6.6.4
  @@ -111,9 +111,10 @@
   
   	//XXX Should it be multiple of DEFAULT_BUFFER_SIZE??
   
  -	if (len <= Constants.DEFAULT_BUFFER_SIZE) {
  -	    tmp = new char [bufferSize + Constants.DEFAULT_BUFFER_SIZE];
  -	    bufferSize = bufferSize * 2;
  +    int newBufferSize = bufferSize * 2;
  +    if (len <= newBufferSize) {
  +	    bufferSize = newBufferSize;
  +	    tmp = new char [bufferSize];
   	} else {
   	    tmp = new char [bufferSize + len];
   	    bufferSize += len;