~ubuntu-branches/ubuntu/vivid/tomcat6/vivid-proposed

« back to all changes in this revision

Viewing changes to java/org/apache/coyote/http11/Http11NioProcessor.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-02-17 00:02:00 UTC
  • mfrom: (1.2.10)
  • Revision ID: package-import@ubuntu.com-20140217000200-qs6ki7bhqnfhkas7
Tags: 6.0.39-1
* Team upload.
* New upstream release.
  - Refreshed the patches
* Standards-Version updated to 3.9.5 (no changes)
* Switch to debhelper level 9
* Use XZ compression for the upstream tarball
* Use canonical URL for the Vcs-Git field

Show diffs side-by-side

added added

removed removed

Lines of Context:
1438
1438
 
1439
1439
        // Parse content-length header
1440
1440
        long contentLength = request.getContentLengthLong();
1441
 
        if (contentLength >= 0 && !contentDelimitation) {
1442
 
            inputBuffer.addActiveFilter
1443
 
                (inputFilters[Constants.IDENTITY_FILTER]);
1444
 
            contentDelimitation = true;
 
1441
        if (contentLength >= 0) {
 
1442
            if (contentDelimitation) {
 
1443
                // contentDelimitation being true at this point indicates that
 
1444
                // chunked encoding is being used but chunked encoding should
 
1445
                // not be used with a content length. RFC 2616, section 4.4,
 
1446
                // bullet 3 states Content-Length must be ignored in this case -
 
1447
                // so remove it.
 
1448
                headers.removeHeader("content-length");
 
1449
                request.setContentLength(-1);
 
1450
            } else {
 
1451
                inputBuffer.addActiveFilter
 
1452
                        (inputFilters[Constants.IDENTITY_FILTER]);
 
1453
                contentDelimitation = true;
 
1454
            }
1445
1455
        }
1446
1456
 
1447
1457
        MessageBytes valueMB = headers.getValue("host");
1736
1746
            }
1737
1747
        }
1738
1748
 
1739
 
        // Add date header
1740
 
        headers.setValue("Date").setString(FastHttpDateFormat.getCurrentDate());
1741
 
 
 
1749
        // Add date header unless application has already set one (e.g. in a
 
1750
        // Caching Filter)
 
1751
        if (headers.getValue("Date") == null) {
 
1752
            headers.setValue("Date").setString(
 
1753
                    FastHttpDateFormat.getCurrentDate());
 
1754
        }
 
1755
        
1742
1756
        // FIXME: Add transfer encoding header
1743
1757
 
1744
1758
        if ((entityBody) && (!contentDelimitation)) {