From f25f1fa2190647ba953404df19fbd96799ce79e8 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 17 Jun 2015 08:52:10 +0000 Subject: [PATCH] Follow up to r1685904: apply the missing 'parsing' bits. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1685950 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_filters.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 1d1df912ada..c6371ed3157 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -502,21 +502,26 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, apr_size_t len; if (!APR_BUCKET_IS_METADATA(e)) { + int parsing = 0; + rv = apr_bucket_read(e, &buffer, &len, APR_BLOCK_READ); + + if (rv == APR_SUCCESS) { + parsing = 1; + rv = parse_chunk_size(ctx, buffer, len, + f->r->server->limit_req_fieldsize); + } if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_INFO, rv, f->r, APLOGNO(01590) "Error reading/parsing chunk %s ", (APR_ENOSPC == rv) ? "(overflow)" : ""); - return rv; - } - - rv = parse_chunk_size(ctx, buffer, len, - f->r->server->limit_req_fieldsize); - if (rv != APR_SUCCESS) { - if (rv != APR_ENOSPC) { - http_error = HTTP_BAD_REQUEST; + if (parsing) { + if (rv != APR_ENOSPC) { + http_error = HTTP_BAD_REQUEST; + } + return bail_out_on_error(ctx, f, http_error); } - return bail_out_on_error(ctx, f, http_error); + return rv; } } -- 2.47.2