tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <r...@apache.org>
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) {
            outputBuffer.addActiveFilter
                (outputFilters[Constants.IDENTITY_FILTER]);
            contentDelimitation = true;
        } else {
            if (entityBody && http11) {
                outputBuffer.addActiveFilter
                    (outputFilters[Constants.CHUNKED_FILTER]);
                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
in
the MimeHeaders object (in that case, the content length of the response
won't
get updated).

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

Remy


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message