tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenny Marks <>
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 

In CoyoteResponse setBufferSize is:

public void setBufferSize(int size) {

         if (isCommitted() || !outputBuffer.isNew())
             throw new IllegalStateException


and OutputBuffer.setBufferSize is:

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

The result is that the buffer size can never be set less than 

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 

Thanks in advance for any advice,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message