From 19cb30c7cf7789ab2e1e14e1db0a2f9522d2412d Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 25 Apr 2010 19:10:45 +0000 Subject: [PATCH] PR49167, unexpected 413 and double-errordoc during a timeout reading a chunk-size. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@937858 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ modules/http/http_filters.c | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e388bbfa77..7c3518cac5 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,11 @@ Changes with Apache 2.3.7 processing is completed, avoiding orphaned callback pointers. [Brett Gervasoni , 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] diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 354e1cafef..abccc1b56f 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -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) { -- 2.40.0