Attached a new version of the patch that uses ap_save_brigade.
Again for 2.0.x.

Regards

RĂ¼diger


On 10/19/2005 02:18 AM, Ruediger Pluem wrote:
> The following patch should fix PR37145. I would like to hear some comments / 
> thoughts
> from brigade / buckets and proxy gurus on this.
> Although this problem has been reported against 2.0.55, I cross checked
> and this problem is also in the trunk.
> 
> Regards
> 
> RĂ¼diger
> 
Index: modules/proxy/proxy_http.c
===================================================================
--- modules/proxy/proxy_http.c  (Revision 312938)
+++ modules/proxy/proxy_http.c  (Arbeitskopie)
@@ -1081,9 +1081,24 @@
         }
 
         apr_brigade_length(temp_brigade, 1, &bytes);
-        APR_BRIGADE_CONCAT(input_brigade, temp_brigade);
         bytes_read += bytes;
 
+        /*
+         * setaside the buckets of temp_brigade before concating input_brigade
+         * with temp_brigade. (At least) in the SSL case temp_brigade contains
+         * transient buckets whose data get overwritten during the next call
+         * of ap_get_brigade in the loop.
+         */
+        status = ap_save_brigade(NULL, &input_brigade, &temp_brigade, p);
+        if (status != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
+                         "proxy: prefetch request body failed to %s"
+                         " from %s (%s) due to setaside problem",
+                         p_conn->name ? p_conn->name: "",
+                         c->remote_ip, c->remote_host ? c->remote_host: "");
+            return status;
+        }
+
     /* Ensure we don't hit a wall where we have a buffer too small
      * for ap_get_brigade's filters to fetch us another bucket,
      * surrender once we hit 80 bytes less than MAX_MEM_SPOOL

Reply via email to