tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <>
Subject Re: [3.3.2-dev] CoyoteConnector2 invalid headers
Date Mon, 03 Jun 2002 22:29:18 GMT
> When using CC2 with TC 3.3.2, every request sets both
> the content-length and the transfer-encoding, which
> is not only wrong, but can confuse some clients.
> Content-Length: 9
> Transfer-Encoding: chunked
> The 4.0 org.apache.catalina.connector.http.HttpConnector
> does not have this problem.  Any quick ideas while I dig
> through the code?

This does not happen with 4.0.x and 4.1.x when using Coyote. I have no idea
why it would happen in 3.3, esp when looking at the code in the
Http11Processor class.

        int contentLength = response.getContentLength();
        if (contentLength != -1) {
            contentDelimitation = true;
        } else {
            if (entityBody && http11) {
                contentDelimitation = true;
                response.addHeader("Transfer-Encoding", "chunked");

That's the only place where the Transfer-Encoding header is set.

There could be a problem when setting the "Content-Length" header directly
the MimeHeaders object (in that case, the content length of the response
get updated).

- coyote.Response.getContentLength should check for a "Content-Length"
if the int value is -1.
- the Tomcat 3 adapter should properly call coyote.Response.setContentLength
the same way the Tomcat 4 adapter does.


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

View raw message