]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* http_filters: Fix handling of unrecognised Transfer Encodings
authorJim Jagielski <jim@apache.org>
Sat, 8 Dec 2007 14:04:34 +0000 (14:04 +0000)
committerJim Jagielski <jim@apache.org>
Sat, 8 Dec 2007 14:04:34 +0000 (14:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602470 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/http/http_filters.c

diff --git a/CHANGES b/CHANGES
index 9636b790b6ae36c0a2c925e9c11c9858dc500ec5..a7a20909c3a18ec8653663fd5106c1e0174f0e0f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.7
 
+  *) core: Handle unrecognised transfer-encodings.
+     PR 43882 [Nick Kew, Jeff Trawick]
+
   *) mod_include: Add an "if" directive syntax to test whether an URL
      is accessible, and if so, conditionally display content. This
      allows a webmaster to hide a link to a private page when the user
diff --git a/STATUS b/STATUS
index b53bb6bce2becf43bffc4ae01e208f0cfb5b4ada..f76fd032afda5cc7d5b69d744cb56fcf0bad1b54 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,13 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * http_filters: Fix handling of unrecognised Transfer Encodings
-    PR 43882
-    http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?r1=592951&r2=599137
-    http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?r1=595672&r2=595671&pathrev=595672 (CHANGES)
-    +1: niq, rpluem, jim
-    niq says: modified in 599059 (following suggestion by trawick)
-
   * mod_ssl: Enable to build with OpenSSL 0.9.9
     trunk:
        http://svn.apache.org/viewvc?view=rev&revision=598019
index 6fabf96e4cfb66f2eb03772dcae204342b2c4839..5e6316fdce86ee891e1eeabfe76f0217f08ce64c 100644 (file)
@@ -115,8 +115,30 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
             if (!strcasecmp(tenc, "chunked")) {
                 ctx->state = BODY_CHUNK;
             }
+            /* 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 ecodings, is unsupported.
+                 */
+                apr_bucket_brigade *bb;
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
+                              "Unknown Transfer-Encoding: %s", tenc);
+                bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
+                e = ap_bucket_error_create(HTTP_NOT_IMPLEMENTED, NULL,
+                                           f->r->pool, f->c->bucket_alloc);
+                APR_BRIGADE_INSERT_TAIL(bb, e);
+                e = apr_bucket_eos_create(f->c->bucket_alloc);
+                APR_BRIGADE_INSERT_TAIL(bb, e);
+                ctx->eos_sent = 1;
+                return ap_pass_brigade(f->r->output_filters, bb);
+            }
+            else {
+                ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, f->r,
+                  "Unknown Transfer-Encoding: %s; using Content-Length", tenc);
+                tenc = NULL;
+            }
         }
-        else if (lenp) {
+        if (lenp && !tenc) {
             char *endstr;
 
             ctx->state = BODY_LENGTH;