summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2000-10-03 00:44:00 +0000
committerRyan Bloom <rbb@apache.org>2000-10-03 00:44:00 +0000
commit3d31ec804b6439b5f23ea036fbdd66a02ae6459d (patch)
tree68faf41d5674731ac8c7b200f610ef3f375ad868 /server
parent532f7b3f39efc66332fc627795cf7af77639a309 (diff)
downloadhttpd-3d31ec804b6439b5f23ea036fbdd66a02ae6459d.tar.gz
Replace ap_get_data_from_filter and ap_save_data_to_filter with
ap_save_brigade. This function does not try to save the actual brigade to a specific location. If just traverses the brigade, calls setaside if it is available and concatenates it with a previously setaside brigade. The resulting brigade is returned to the caller for them to save it to the appropriate location. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/util_filter.c37
1 files changed, 5 insertions, 32 deletions
diff --git a/server/util_filter.c b/server/util_filter.c
index 2b0ff6f29c..c7641c3c3f 100644
--- a/server/util_filter.c
+++ b/server/util_filter.c
@@ -209,48 +209,21 @@ API_EXPORT(apr_status_t) ap_pass_brigade(ap_filter_t *next, ap_bucket_brigade *b
return AP_NOBODY_WROTE;
}
-API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(ap_filter_t *f,
- ap_bucket_brigade **b)
+API_EXPORT(void) ap_save_brigade(ap_filter_t *f, ap_bucket_brigade **saveto,
+ ap_bucket_brigade **b)
{
- ap_bucket_brigade *bb = (ap_bucket_brigade *)f->ctx;
-
- /* If we have never stored any data in the filter, then we had better
- * create an empty bucket brigade so that we can concat.
- */
- if (!bb) {
- bb = ap_brigade_create(f->r->pool);
- }
-
- /* join the two brigades together. *b is now empty so we can
- * safely destroy it.
- */
- AP_BRIGADE_CONCAT(bb, *b);
- ap_brigade_destroy(*b);
- /* clear out the filter's context pointer. If we don't do this, then
- * when we save more data to the filter, we will be appended to what is
- * currently there. This will mean repeating data.... BAD! :-)
- */
- f->ctx = NULL;
-
- return bb;
-}
-
-API_EXPORT(void) ap_save_data_to_filter(ap_filter_t *f, ap_bucket_brigade **b)
-{
- ap_bucket_brigade *bb = (ap_bucket_brigade *)f->ctx;
ap_bucket *e;
/* If have never stored any data in the filter, then we had better
* create an empty bucket brigade so that we can concat.
*/
- if (!bb) {
- bb = ap_brigade_create(f->r->pool);
+ if (!(*saveto)) {
+ *saveto = ap_brigade_create(f->r->pool);
}
AP_RING_FOREACH(e, &(*b)->list, ap_bucket, link) {
if (e->setaside)
e->setaside(e);
}
- AP_BRIGADE_CONCAT(bb, *b);
- f->ctx = bb;
+ AP_BRIGADE_CONCAT(*saveto, *b);
}