]> granicus.if.org Git - apache/commitdiff
Revert mis-commit 1541372
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 13 Nov 2013 03:04:00 +0000 (03:04 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 13 Nov 2013 03:04:00 +0000 (03:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1541373 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/http/http_filters.c
server/protocol.c

diff --git a/CHANGES b/CHANGES
index 12f519568d086a704af92dfaf63f080100e051fb..8c3a90df62936d20ff9b92c131009e6cbc8f6dfa 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,9 +2,6 @@
 
 Changes with Apache 2.4.7
 
-  *) core: draft-ietf-httpbis-p1-messaging-23 corrections regarding
-     TE/CL conflicts. [Yann Ylavic <ylavic.dev gmail com>, Jim Jagielski]
-
   *) mod_authn_socache: Support optional initialization arguments for
      socache providers.  [Chris Darroch]
 
diff --git a/STATUS b/STATUS
index 12407d8b4b61ee97aaa63cab45134c30cb67e74e..2ad4a9b2b424171888ddec1bdb013fb729ecc876 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -218,7 +218,7 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
                  https://svn.apache.org/viewvc?view=revision&revision=1541270
                  https://svn.apache.org/viewvc?view=revision&revision=1541368
     2.4.x patch (plus CHANGES entry above):
-      http://people.apache.org/~wrowe/httpd-2.4-r1524192-r1524770-TE-CL-v2.patch
+        http://people.apache.org/~wrowe/httpd-2.4-r1524192-r1524770-TE-CL.patch
     +1:
     [wrowe asks] Where is verification of (!keepalive)?  Do we know the
                  connection will be closed anytime in the near future?
index 1676ff8866795ff83505455e1a612125232bab9c..c72741945372357a1678533c05722f620d4f4b37 100644 (file)
@@ -259,29 +259,25 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
         lenp = apr_table_get(f->r->headers_in, "Content-Length");
 
         if (tenc) {
-            if (strcasecmp(tenc, "chunked") == 0 /* fast path */
-                    || ap_find_last_token(f->r->pool, tenc, "chunked")) {
+            if (!strcasecmp(tenc, "chunked")) {
                 ctx->state = BODY_CHUNK;
             }
-            else if (f->r->proxyreq == PROXYREQ_RESPONSE) {
-                /* http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-23
-                 * Section 3.3.3.3: "If a Transfer-Encoding header field is
-                 * present in a response and the chunked transfer coding is not
-                 * the final encoding, the message body length is determined by
-                 * reading the connection until it is closed by the server."
+            /* test lenp, because it gives another case we can handle */
+            else if (!lenp) {
+                /* Something that isn't in HTTP, unless some future
+                 * edition defines new transfer encodings, is unsupported.
                  */
-                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, f->r, APLOGNO(01586)
-                              "Unknown Transfer-Encoding: %s;"
-                              " using read-until-close", tenc);
-                tenc = NULL;
-            }
-            else {
-                ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, f->r, APLOGNO(01585)
+                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, f->r, APLOGNO(01585)
                               "Unknown Transfer-Encoding: %s", tenc);
                 return bail_out_on_error(ctx, f, HTTP_NOT_IMPLEMENTED);
             }
+            else {
+                ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, f->r, APLOGNO(01586)
+                  "Unknown Transfer-Encoding: %s; using Content-Length", tenc);
+                tenc = NULL;
+            }
         }
-        if (lenp) {
+        if (lenp && !tenc) {
             char *endstr;
 
             ctx->state = BODY_LENGTH;
index 36e1292ceed28c51a010b9f6e71fb8cd807b13fa..a0b3246427e098b65a57ba801d7ece4e0426292c 100644 (file)
@@ -997,8 +997,6 @@ request_rec *ap_read_request(conn_rec *conn)
     }
 
     if (!r->assbackwards) {
-        const char *tenc;
-
         ap_get_mime_headers_core(r, tmp_bb);
         if (r->status != HTTP_OK) {
             ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00567)
@@ -1010,34 +1008,12 @@ request_rec *ap_read_request(conn_rec *conn)
             goto traceout;
         }
 
-        tenc = apr_table_get(r->headers_in, "Transfer-Encoding");
-        if (tenc) {
-            /* http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-23
-             * Section 3.3.3.3: "If a Transfer-Encoding header field is
-             * present in a request and the chunked transfer coding is not
-             * the final encoding ...; the server MUST respond with the 400
-             * (Bad Request) status code and then close the connection".
-             */
-            if (!(strcasecmp(tenc, "chunked") == 0 /* fast path */
-                    || ap_find_last_token(r->pool, tenc, "chunked"))) {
-                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02539)
-                              "client sent unknown Transfer-Encoding "
-                              "(%s): %s", tenc, r->uri);
-                r->status = HTTP_BAD_REQUEST;
-                conn->keepalive = AP_CONN_CLOSE;
-                ap_send_error_response(r, 0);
-                ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
-                ap_run_log_transaction(r);
-                apr_brigade_destroy(tmp_bb);
-                goto traceout;
-            }
-
-            /* http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-23
-             * Section 3.3.3.3: "If a message is received with both a
-             * Transfer-Encoding and a Content-Length header field, the
-             * Transfer-Encoding overrides the Content-Length. ... A sender
-             * MUST remove the received Content-Length field".
-             */
+        if (apr_table_get(r->headers_in, "Transfer-Encoding")
+            && apr_table_get(r->headers_in, "Content-Length")) {
+            /* 2616 section 4.4, point 3: "if both Transfer-Encoding
+             * and Content-Length are received, the latter MUST be
+             * ignored"; so unset it here to prevent any confusion
+             * later. */
             apr_table_unset(r->headers_in, "Content-Length");
         }
     }