tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenny Marks <le...@aps.org>
Subject Tomcat 5; can't set response bufferSize < 8K
Date Tue, 10 Aug 2004 22:31:32 GMT
It seams it is impossible to set the response buffer 
size(response.setBufferSize)  with anything less than 8K. That is, 
response.getBufferSize() still returns 8K. Anything over 8K does work. 
I downloaded the source and pinned it down to the following:

In org.apache.coyote.tomcat5.CoyoteResponse an outputBuffer is 
initialized with 'new OutputBuffer()'.  The default constructor of 
OutputBuffer then internally creates a new ByteChunk with a 'limit' of 
DEFAULT_BUFFER_SIZE, which is 8K.

In CoyoteResponse setBufferSize is:

public void setBufferSize(int size) {

         if (isCommitted() || !outputBuffer.isNew())
             throw new IllegalStateException
                 (sm.getString("coyoteResponse.setBufferSize.ise"));

         outputBuffer.setBufferSize(size);
  }

and OutputBuffer.setBufferSize is:

  public void setBufferSize(int size) {
         if (size > bb.getLimit()) {// ??????
             bb.setLimit(size);
         }
    }

The result is that the buffer size can never be set less than 
OutputBuffer.DEFAULT_BUFFER_SIZE or 8K.

Is there any good reason for this? The question marks make me wonder. 
For now I just changed the DEFAULT_BUFFER_SIZE to 1K. Also, I'm not 
sure how this is related to bufferSize and socketBuffer for the HTTP1.1 
Connector. I sounds like bufferSize is related to reading the request. 
Should it be that socketBuffer is the default bufferSize for a response?

BTW, I had done a lot of searching on this issue. I didn't find any 
related bugs or postings on the Tomcat mailing lists. I had come across 
one or two postings on various other lists from people having the same 
problem, but the threads were never answered. I myself, am new to this 
list.

Thanks in advance for any advice,
-lenny


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


Mime
View raw message