tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 55842] New: response.setBufferSize() does not seem to work properly
Date Wed, 04 Dec 2013 15:56:09 GMT

            Bug ID: 55842
           Summary: response.setBufferSize() does not seem to work
           Product: Tomcat 7
           Version: 7.0.47
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina

I found a problem with setting the buffer size for the ServletResponse. 
If I call 'response.setBufferSize(1,000,000);' and send about 20,000
characters, the response will be chunked even though it should not.
The response is sent in several chunks and contains the 'Transfer-Encoding:
chunked' response header.
In my understanding in this case the response should be fully buffered on the
server and then sent as a whole containing the Content-Length-header.

This causes a problem in my application because I want to use a larger buffer
to be able to redirect to an error page if an error occurs during rendering the

I was able to reproduce this on Tomcat 7.0.39, 7.0.40, 7.0.42, 7.0.47. Tomcat
7.0.37 works fine and as expected.

This is easily reproducable by using a JSP as follows:
for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
    response.getWriter().write("<br />");

You are receiving this mail because:
You are the assignee for the bug.

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

View raw message