diff options
author | Ruediger Pluem <rpluem@apache.org> | 2010-09-21 11:23:39 +0200 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2010-09-21 11:23:39 +0200 |
commit | 85c753fe0d21d221a68edb6b4048584e2c005926 (patch) | |
tree | 6aa93f38cb79531e80a7ab3495e3847e8bedcd81 /modules/proxy/mod_proxy_http.c | |
parent | Removing ``FAQs'' which are *really* out of date. (diff) | |
download | apache2-85c753fe0d21d221a68edb6b4048584e2c005926.tar.xz apache2-85c753fe0d21d221a68edb6b4048584e2c005926.zip |
* LimitRequestBody does not affect Proxy requests (Should it?).
Let it take effect if we decide to store the body in a
temporary file on disk.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999288 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/mod_proxy_http.c')
-rw-r--r-- | modules/proxy/mod_proxy_http.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 518bf96e59..d1de99a3f7 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -555,9 +555,12 @@ static int spool_reqbody_cl(apr_pool_t *p, apr_bucket *e; apr_off_t bytes, bytes_spooled = 0, fsize = 0; apr_file_t *tmpfile = NULL; + apr_off_t limit; body_brigade = apr_brigade_create(p, bucket_alloc); + limit = ap_get_limit_req_body(r); + while (!APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(input_brigade))) { /* If this brigade contains EOS, either stop or remove it. */ @@ -572,6 +575,18 @@ static int spool_reqbody_cl(apr_pool_t *p, apr_brigade_length(input_brigade, 1, &bytes); if (bytes_spooled + bytes > MAX_MEM_SPOOL) { + /* + * LimitRequestBody does not affect Proxy requests (Should it?). + * Let it take effect if we decide to store the body in a + * temporary file on disk. + */ + if (bytes_spooled + bytes > limit) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, + "proxy: Request body is larger than the" + " configured limit of %" APR_OFF_T_FMT ".", + limit); + return HTTP_REQUEST_ENTITY_TOO_LARGE; + } /* can't spool any more in memory; write latest brigade to disk */ if (tmpfile == NULL) { const char *temp_dir; |