tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: Erratic HTTP response behavior
Date Sat, 26 May 2007 01:12:04 GMT

"Christopher Schultz" <> wrote in message
> Hash: SHA1
> Matt,
> You're right, this /is/ erratic behavior. I think something is going
> wrong with your headers or something:
> Matt Cosentino wrote:
>> </body></html>0 HTTP/1.1 200 OKServer: 
>> Apache-Coyote/1.1Transfer-Encoding: chunkedDate: Fri, 18 May 2007 
>> 22:35:13 GMT
> Your response headers appear to be after the body of the response.
> Either that or the headers I see there are supposed to be the headers
> from the next chunk and/or request in a keepalive request.

Indeed :).  This is the start of the next response in the pipeline, and 
should look like:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Fri, 18 May 2007 22:35:13 GMT

It looks like some 'friendly' intermediate is compressing out the "\r\n" 
codes that are needed to interpret 'chunked'.  To not use 'chunked', you 
have to set the Content-Length yourself (or have only very small pages and 
don't call flush).  If your pages aren't too huge, and you don't have too 
high of concurrency, it is pretty easy to write a Filter that wraps the 
response to hold the output in memory until it is all there, and then set 
the Content-Length before passing it back to the browser.

> Are you intending to use "chunked" responses? 'Cause it looks like they
> are being used. There was some in-depth discussion of chunked responses
> somewhat recently on the list. Perhaps you could take a look at that for
> some reference points (but I'm not saying that it will solve your 
> problem).
> I think the problem might be that you are getting chunked encoding for
> some reason, but you don't really want it.
> - -chris
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla -
> sJuvF8+a8MgIcIu3gd1hGak=
> =u9oS
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message