tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Deshayes" <ericdesha...@gmail.com>
Subject Re: Connection:close request returns a response without any content-length or Transfer-Encoding: chunked
Date Mon, 21 May 2007 16:53:55 GMT
Hi Johnny,
I am just retrieving the default root page of tomcat:

GET / HTTP/1.1

I understand what you mean, but that's the default tomcat page. So, I do not
really see what's difficult in getting the content-length.
I am not using any servlet... It's when I am accessing http://127.0.0.1:8080
.
Regards,
Eric





On 5/21/07, Johnny Kewl <john@kewlstuff.co.za> wrote:
>
>
> Hi Eric... again...I dont think its a bug...
> Have you checked that the Servlet is setting the content length..... ie
> response.setContentLength(theByteLength);
>
> This is the Javadoc comments from the actual Tomcat src code...
>      * <p>The servlet container must write the headers before
>      * committing the response, because in HTTP the headers must be sent
>      * before the response body.
>      *
>      * <p>Where possible, set the Content-Length header (with the
>      * {@link javax.servlet.ServletResponse#setContentLength} 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.
>      *
>      * <p>When using HTTP 1.1 chunked encoding (which means that the
> response
>      * has a Transfer-Encoding header), do not set the Content-Length
> header.
>
> Can you see what its saying... ie if you dont explicitly set
> setContentLength... its just luck whether you get it or not.
> Because the system will try maintain a keep alive.... IF IT FITS IN THE
> BUFFER.... theres a header... if not... the system cant work it out
> because
> when the buffer is full... it has to let it go... so as soon as it gets to
> that state **without** a "setContentLength"... its going to revert back to
> http 1.0 and close the connection.
> ... and it will not display the ContentLength header.
>
> Can you see that even if the server could calculate it across multiple
> buffers... its no good... because the browser will already have the
> headers
> from the first buffer and servlet is still calculating!!
>
> So... "are you sure" that your servlet has EXPLICITLY
> ***setContentLength(theByteLength);***
>
> If its not your servlet... and you cant change it.... can you see the
> kludge... ie if you make the buffer size enormous... you will get headers,
> but that is really crap coding... if you can, fix the servlet source.
>
> Can you post the servlet source?... I think the problem is there...
>
>
> ----- Original Message -----
> From: "Eric Deshayes" <ericdeshayes@gmail.com>
> To: "Tomcat Users List" <users@tomcat.apache.org>
> Sent: Monday, May 21, 2007 3:37 AM
> Subject: Re: Connection:close request returns a response without any
> content-length or Transfer-Encoding: chunked
>
>
> > Hi Johnny,
> > thanks for your help.
> > By dichotomy, I've managed that the bug has been fixed in Tomcat 5.5.16.
> > However, I could not find any bug even by having a look at the tomcat
> > 5.5changelog.
> > Eric
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
----------------------------------------------------------------------
ERIC DESHAYES

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message