You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Wolfgang Hoschek <wo...@cern.ch> on 2001/09/29 15:41:25 UTC

[TC4] Missing automatic content length, was: Re: Filters and Transfer-Encoding: chunked

Noticed a further point where TC4 seems to violate the 2.3 spec.
Spec 2.3 (and javadoc) says on HTTPServlet.doGet, doPost, etc.

"Where possible, set the Content-Length header (with the
     ServletResponse.setContentLength(int) method), to allow the servlet 
container to use
     a persistent connection to return its response to the client, 
improving performance. The
     content length is automatically set if the entire response fits inside 
the response buffer."

As far as I can see from the TC4 http.HttpConnector and related source the 
content length is never automatically set, no matter what buffer size. 
Without content-length many HTTP clients approach 100% CPU consumption 
because reading a response reliably without knowing its length is 
expensive. Also prevents persistent connections.

Am I missing something?

Wolfgang.