]> granicus.if.org Git - apache/commitdiff
Re-work the explanation in commentary and debug logging of
authorJeff Trawick <trawick@apache.org>
Sun, 11 Nov 2007 14:32:58 +0000 (14:32 +0000)
committerJeff Trawick <trawick@apache.org>
Sun, 11 Nov 2007 14:32:58 +0000 (14:32 +0000)
when modules and scripts may be harmed by transformation of
the request body.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@593890 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_charset_lite.c

index 903b3923755d3fc1ecfb2e7417b6f3a230a9457f..1489e4316ce2a227ebc23488b667adc46906d5a4 100644 (file)
@@ -1060,15 +1060,21 @@ static int xlate_in_filter(ap_filter_t *f, apr_bucket_brigade *bb,
     if (!ctx->ran) {  /* filter never ran before */
         chk_filter_chain(f);
         ctx->ran = 1;
-        if (!ctx->noop && !ctx->is_sb) {
-            /* We're not converting between two single-byte charsets, so note
-             * that some handlers can't deal with it.
-             * It doesn't help to unset Content-Length in the input header
-             * table since in all likelihood the handler has already seen it.
+        if (!ctx->noop && !ctx->is_sb
+            && apr_table_get(f->r->headers_in, "Content-Length")) {
+            /* A Content-Length header is present, but it won't be valid after
+             * conversion because we're not converting between two single-byte
+             * charsets.  This will affect most CGI scripts and may affect
+             * some modules.
+             * Content-Length can't be unset here because that would break
+             * being able to read the request body.
+             * Processing of chunked request bodies is not impacted by this
+             * filter since the the length was not declared anyway.
              */
             if (dc->debug >= DBGLVL_PMC) {
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r,
-                              "Request body length may change, breaking some requests");
+                              "Request body length may change, resulting in "
+                              "misprocessing by some modules or scripts");
             }
         }
     }