tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47736] Content-Length Missing (
Date Tue, 25 Aug 2009 21:14:50 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47736


neng1998@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Content-Length Missing      |Content-Length Missing (


--- Comment #1 from neng1998@yahoo.com 2009-08-25 14:14:47 PDT ---
The bugs is at 1538

Http11Processor: line 1531 – 1547

       long contentLength = response.getContentLengthLong();
        if (contentLength != -1) {
            headers.setValue("Content-Length").setLong(contentLength);
            outputBuffer.addActiveFilter
                (outputFilters[Constants.IDENTITY_FILTER]);
            contentDelimitation = true;
        } else {
Line 1538            if (entityBody && http11 && keepAlive) {
                outputBuffer.addActiveFilter
                    (outputFilters[Constants.CHUNKED_FILTER]);
                contentDelimitation = true;
               
headers.addValue(Constants.TRANSFERENCODING).setString(Constants.CHUNKED);
            } else {
                outputBuffer.addActiveFilter
                    (outputFilters[Constants.IDENTITY_FILTER]);
            }
        }

When using HTTP 1.1 protocol, based on HTTP 1.1 spec 3.6. Server will use
Chunked Transfer Coding. Line 1538 works well when keepAlive is true. 
Either client does not want keepAlive or Server refuse keepAlive, line 1538
condition become false, Server will not use “Chunked Transfer Coding”. This is
wrong. Using Chunked Transfer Coding should NOT be impacted by whether
keepAlive is true or not because they are unrelated HTTP feature. 

Worse, it does not return content-length unless Application code calls
response.setContentLength() method. This is not right. For HTTP 1.1, either
Content-Length or Chunked Transfer Coding should present. If Application code
does not explicitly call response.setContentLenght(), Server should still
figure out content length itself if not using Chunked Transfer Coding.

Note: HTTP 1.0 does not support Chunked Transfer Coding and does not require
Content-Length neither. 

I think we should remove keepAlive in line 1638.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message