You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2010/09/21 11:23:39 UTC
svn commit: r999288 - /httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
Author: rpluem
Date: Tue Sep 21 09:23:39 2010
New Revision: 999288
URL: http://svn.apache.org/viewvc?rev=999288&view=rev
Log:
* 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.
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?rev=999288&r1=999287&r2=999288&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Tue Sep 21 09:23:39 2010
@@ -555,9 +555,12 @@ static int spool_reqbody_cl(apr_pool_t *
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 *
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;