1. Yes, tomcat is sending the header: "Transfer-Encoding: chunked"
2. I've also tried using close() instead of flush() and I've seen the same 
chunked encoding.
3. The nginx reverse proxying with the HttpProxyModule only supports HTTP/1.0 
according to the "Synopsis" section here: http://wiki.nginx.org/HttpProxyModule

Based on my reading of the HTTP spec, closing the connection seems to be a 
valid alternative to sending the terminating "0\r\n\r\n".
Any ideas about why the connection wouldn't be closed when using APR?

On March 11, 2011 09:35:56 am Christopher Schultz wrote:
> Chris,
> 
> On 3/10/2011 12:37 PM, Chris wrote:
> >  As I mentioned below, the "0\r\n\r\n" was not being sent to nginx, 
> > although it was being sent to curl. The difference was that nginx was doing 
> > a GET HTTP/1.0, while curl was using HTTP/1.1. If I configure curl to use 
> > HTTP/1.0 then I get the same result: no "0\r\n\r\n" is sent.
> >
> > So, to summarize:
> > - GET HTTP/1.0 results in no terminating "0\r\n\r\n" for the chunked 
> > response, regardless of whether libtcnative is being used.
> > - The difference when using libtcnative is that the connection isn't 
> > terminated after the response is sent.
> 
> Good catch with the HTTP 1.0 versus 1.1.
> 
> I'm not exactly an expert at HTTP spec and compliance, but I'm pretty
> sure that the following are true:
> 
> 1. HTTP 1.0 does not support chunked encoding, therefore Tomcat is
>    somewhat correct in it's failure to send a trailing 0\r\n\r\n.
>    Does Tomcat send a "chunked" response header?
> 
> 2. Calling response.flush() often triggers the use of chunked encoding,
>    which could cause Tomcat to make a poor decision when HTTP 1.0 is
>    involved.
> 
> Is it possible to configure nginx to use HTTP 1.1? I would think you'd
> want to use 1.1 anyway.
> 
> -chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to