Hi again :)
I did a patch modifiying mod_proxy to pass the entire data (response
from backend server) to output_filter, unstead of brigade per brigade.
it seems to work well...
Matthieu
Matthieu Estrade wrote:
>
> Hi again,
>
> the problem seems to be in the proxy.
>
> When proxy read the data and pass it to output filter, it do:
>
> while (ap_get_brigade){
>
> ap_pass_brigade(output_filter)
>
> }
>
> si if the data aren't read by only one brigade, the mod_cache can't work.
> because it will try to cache only the first brigade with a part of data.
>
> Do you think it's better to modify how proxy is passing data to the
> output_filter
> or to modify the way mod_cache is getting his data from bucket_brigade ?
>
> Matthieu
>
> Matthieu Estrade wrote:
>
>
? proxy_http.patch
Index: proxy_http.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/proxy/proxy_http.c,v
retrieving revision 1.160
diff -u -r1.160 proxy_http.c
--- proxy_http.c 22 Aug 2002 15:02:49 -0000 1.160
+++ proxy_http.c 23 Sep 2002 11:58:44 -0000
@@ -679,6 +679,8 @@
char keepchar;
request_rec *rp;
apr_bucket *e;
+ apr_bucket_brigade *send_to_client = apr_brigade_create(p, c->bucket_alloc);
+
int len, backasswards;
int received_continue = 1; /* flag to indicate if we should
* loop over response parsing logic
@@ -931,13 +933,8 @@
finish = TRUE;
}
- /* try send what we read */
- if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS) {
- /* Ack! Phbtt! Die! User aborted! */
- p_conn->close = 1; /* this causes socket close below */
- finish = TRUE;
- }
-
+ APR_BRIGADE_CONCAT(send_to_client,bb);
+
/* make sure we always clean up after ourselves */
apr_brigade_cleanup(bb);
@@ -946,6 +943,14 @@
break;
}
}
+
+ /* try send what we read */
+ if (ap_pass_brigade(r->output_filters, send_to_client) != APR_SUCCESS) {
+ /* Ack! Phbtt! Die! User aborted! */
+ p_conn->close = 1; /* this causes socket close below */
+ }
+
+
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: end body send");