]> granicus.if.org Git - apache/commitdiff
PR49167, unexpected 413 and double-errordoc during a timeout reading a
authorEric Covener <covener@apache.org>
Sun, 25 Apr 2010 19:10:45 +0000 (19:10 +0000)
committerEric Covener <covener@apache.org>
Sun, 25 Apr 2010 19:10:45 +0000 (19:10 +0000)
chunk-size.

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

CHANGES
modules/http/http_filters.c

diff --git a/CHANGES b/CHANGES
index e388bbfa77c2f753211273a650e64b67cf6dad16..7c3518cac5eb3fc315a42141741214196db130b5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -28,6 +28,11 @@ Changes with Apache 2.3.7
      processing is completed, avoiding orphaned callback pointers.
      [Brett Gervasoni <brettg senseofsecurity.com>, Jeff Trawick]
 
+  *) Log an error for failures to read a chunk-size, and return 400 instead
+     413 when this is due to a read timeout.  This change also fixes some cases 
+     of two error documents being sent in the response for the same scenario. 
+     [Eric Covener] PR49167
+
   *) mod_proxy_balancer: Add new directive BalancerNonce to allow admin
      to control/set the nonce used in the balancer-manager application.
      [Jim Jagielski]
index 354e1cafefa452b21463a9e024849f337774a5c7..abccc1b56f0a1b218a9a8ca156ff1f5a6fc74367 100644 (file)
@@ -383,8 +383,13 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
 
             /* Detect chunksize error (such as overflow) */
             if (rv != APR_SUCCESS || ctx->remaining < 0) {
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r, "Error reading first chunk %s ", 
+                              (ctx->remaining < 0) ? "(overflow)" : "");
                 ctx->remaining = 0; /* Reset it in case we have to
                                      * come back here later */
+                if (APR_STATUS_IS_TIMEUP(rv)) { 
+                    http_error = HTTP_BAD_REQUEST;
+                }
                 return bail_out_on_error(ctx, f, http_error);
             }
 
@@ -484,10 +489,14 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
 
                 /* Detect chunksize error (such as overflow) */
                 if (rv != APR_SUCCESS || ctx->remaining < 0) {
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r, "Error reading chunk %s ", 
+                                  (ctx->remaining < 0) ? "(overflow)" : "");
                     ctx->remaining = 0; /* Reset it in case we have to
                                          * come back here later */
-                    bail_out_on_error(ctx, f, http_error);
-                    return rv;
+                    if (APR_STATUS_IS_TIMEUP(rv)) { 
+                        http_error = HTTP_BAD_REQUEST;
+                    }
+                    return bail_out_on_error(ctx, f, http_error);
                 }
 
                 if (!ctx->remaining) {