]> granicus.if.org Git - apache/commitdiff
A client POST request would be read entirely into RAM before sending it
authorGraham Leggett <minfrin@apache.org>
Tue, 10 Apr 2001 20:55:05 +0000 (20:55 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 10 Apr 2001 20:55:05 +0000 (20:55 +0000)
on the client - a potential DoS. Fixed.
PR:
Obtained from:
Reviewed by:

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

modules/proxy/proxy_http.c

index e99aa2e653b95b489ac19557b5ad6c338060e129..753e719f596d638ebbd24b39f0af3a0249bb86a3 100644 (file)
@@ -558,17 +558,15 @@ int ap_proxy_http_handler(request_rec *r, char *url,
     /* send the request data, if any. */
     if (ap_should_client_block(r)) {
        while ((i = ap_get_client_block(r, buffer, sizeof buffer)) > 0) {
-/* XXX FIXME: Only sends downstream when request is fully loaded */
             e = apr_bucket_pool_create(buffer, i, p);
             APR_BRIGADE_INSERT_TAIL(bb, e);
+           e = apr_bucket_flush_create();
+           APR_BRIGADE_INSERT_TAIL(bb, e);
+           ap_pass_brigade(origin->output_filters, bb);
+           apr_brigade_cleanup(bb);
         }
     }
 
-    /* Flush the data to the origin server */
-    e = apr_bucket_flush_create();
-    APR_BRIGADE_INSERT_TAIL(bb, e);
-    ap_pass_brigade(origin->output_filters, bb);
-
 
     /*
      * Step Four: Receive the Response