]> granicus.if.org Git - apache/commitdiff
Fix seg fault in HTTP_IN when trying to handle the LimitRequestBody
authorBill Stoddard <stoddard@apache.org>
Thu, 3 Jan 2002 19:20:54 +0000 (19:20 +0000)
committerBill Stoddard <stoddard@apache.org>
Thu, 3 Jan 2002 19:20:54 +0000 (19:20 +0000)
directive when reading a proxy response. We should bypass LimitRequestBody
activities when handling a response from the proxied server.

I don't think this will circumvent requestbody checking on a large request
coming into the server that is destined to be proxied. (not tested though).

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

modules/http/http_protocol.c
modules/proxy/proxy_util.c

index b8db820e04979da500e46cf87cf998ff41df77b0..8b202544bad458bafc7b9bbb713d0123c9464aa0 100644 (file)
@@ -519,9 +519,11 @@ typedef struct http_filter_ctx {
     } state;
 } http_ctx_t;
 
-/* This is the input filter for HTTP requests.  It handles chunked and
- * content-length bodies.  This can only be inserted/used after the headers
- * are successfully parsed. */
+/* This is the HTTP_INPUT filter for HTTP requests and responses from 
+ * proxied servers (mod_proxy).  It handles chunked and content-length 
+ * bodies.  This can only be inserted/used after the headers
+ * are successfully parsed. 
+ */
 apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
                             ap_input_mode_t mode, apr_off_t *readbytes)
 {
@@ -540,7 +542,18 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
         ctx->state = BODY_NONE;
         ctx->remaining = 0;
         ctx->limit_used = 0;
-        ctx->limit = ap_get_limit_req_body(f->r);
+
+        /* LimitRequestBody does not apply to proxied responses.
+         * Consider implementing this check in its own filter. 
+         * Would adding a directive to limit the size of proxied 
+         * responses be useful?
+         */
+        if (!f->r->proxyreq) {
+            ctx->limit = ap_get_limit_req_body(f->r);
+        }
+        else {
+            ctx->limit = 0;
+        }
 
         tenc = apr_table_get(f->r->headers_in, "Transfer-Encoding");
         lenp = apr_table_get(f->r->headers_in, "Content-Length");
index 1d35acda54925dc570bb929649539384fd27afc7..e23ba0cd866e0244461e2065d6e797d2d927b81e 100644 (file)
@@ -374,6 +374,7 @@ PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r)
     rp->notes           = apr_table_make(c->pool, 5);
 
     rp->server = r->server;
+    rp->proxyreq = r->proxyreq;
     rp->request_time = r->request_time;
     rp->connection      = c;
     rp->output_filters  = c->output_filters;