diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-07-24 21:42:40 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-07-24 21:42:40 +0000 |
commit | 12addc1f1ea45ea9874da2eb15e89104e37a36ab (patch) | |
tree | 6ec8510f859f68ffca6950c3a8b6db1514e4a9f3 /buckets | |
parent | 21b59fbe4410230e941081f4ec3abb7610321eb0 (diff) | |
download | libapr-12addc1f1ea45ea9874da2eb15e89104e37a36ab.tar.gz |
Remove util_filter.c and util_filter.h. This is in preparation for
combining all of the code that registers a filter. I am also removing
these from README.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60437 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buckets')
-rw-r--r-- | buckets/README.txt | 2 | ||||
-rw-r--r-- | buckets/util_filter.c | 140 | ||||
-rw-r--r-- | buckets/util_filter.h | 115 |
3 files changed, 0 insertions, 257 deletions
diff --git a/buckets/README.txt b/buckets/README.txt index f69e34347..d0814e6c6 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -36,8 +36,6 @@ Bachelor #1 ap_rwmem_buf.c ap_rmem_buf.c ap_eos_buf.c - util_filter.h - util_filter.c ryan.patch Bachelor #2 diff --git a/buckets/util_filter.c b/buckets/util_filter.c deleted file mode 100644 index 177617854..000000000 --- a/buckets/util_filter.c +++ /dev/null @@ -1,140 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include "httpd.h" -#include "util_filter.h" - -API_EXPORT(ap_filter_t *) ap_init_filter(ap_pool_t *p) -{ - ap_filter_t *f = ap_pcalloc(p, sizeof(f)); - return f; -} - -API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *buf) -{ - int rv; - LINK_filter *hook; - - if (next->current_filter > r->filters->nelts) { - return AP_ENOBODY_WROTE; - } - - hook = (LINK_filter *)r->filters->elts; - rv = hook[next->current_filter++].pFunc(r, next, buf); - next->current_filter--; - return rv; -} - -API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *data) -{ - LINK_filter *hook; - - hook = ((LINK_filter *)r->filters->elts); - - if (hook->filter_data) { - ap_bucket_brigade_catenate(hook->filter_data, data); - } - else { - hook->filter_data = data; - } -} - -API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, - ap_filter_t *next, - ap_bucket_brigade **data) -{ - LINK_filter *hook; - - hook = ((LINK_filter *)r->filters->elts); - - if (hook->filter_data) { - ap_bucket_brigade_catenate(hook->filter_data, *data); - *data = hook->filter_data; - } - hook->filter_data = NULL; - return *data; -} - -API_EXPORT(void) ap_hook_filter(HOOK_filter *pf, request_rec *r, - const char * const *aszPre, - const char * const *aszSucc, int nOrder) -{ - LINK_filter *hook; - - if(!r->filters) { - r->filters=ap_make_array(ap_global_hook_pool,1,sizeof(LINK_filter)); - ap_hook_sort_register("filter",&r->filters); - } - - hook = (LINK_filter *)r->filters->elts; - - hook=ap_push_array(r->filters); - hook->pFunc=pf; - hook->aszPredecessors=aszPre; - hook->aszSuccessors=aszSucc; - hook->nOrder=nOrder; - hook->szName=ap_debug_module_name; - hook->filter_data = ap_bucket_brigade_create(r->pool); - if(ap_debug_module_hooks) { - ap_show_hook("filter",aszPre,aszSucc); - } -} - - diff --git a/buckets/util_filter.h b/buckets/util_filter.h deleted file mode 100644 index 4921c3ca4..000000000 --- a/buckets/util_filter.h +++ /dev/null @@ -1,115 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef APACHE_FILTER_H -#define APACHE_FILTER_H - -#include "ap_config.h" - -/* For ap_array_header_t */ -#include "apr_lib.h" -#include "httpd.h" -#include "apr_buf.h" -#include "ap_hooks.h" /* For the hooks ordering stuff */ - -typedef struct ap_filter_t { - int current_filter; -} ap_filter_t; - -typedef int HOOK_filter(request_rec *r, ap_filter_t *next, ap_bucket_brigade *buckets); - -typedef struct _LINK_filter { - HOOK_filter *pFunc; - const char *szName; - const char * const *aszPredecessors; - const char * const *aszSuccessors; - int nOrder; - ap_bucket_brigade *filter_data; -} LINK_filter; - -#define AP_HOOK_FILTER 0 /* content-filter/munger/processor */ -#define AP_HOOK_ENCODING 10 /* content-encoding */ -#define AP_HOOK_PROCESSOR 20 /* digest/message processor */ -#define AP_HOOK_TRANSPORT 30 /* transport-encoding */ - -/* This is usually the core filter. This ensures that there is always a - * filter that can/will write out to the network. If some other module - * wants to actually do the writing, they just insert themselves before - * this filter. This is just like the default handler in 1.3. If no other - * handler took care of the request, then the default took it. Same thing, if - * no other Transport filter writes this to the network, then the default - * (core) filter will be used. - */ -#define AP_HOOK_TRANSPORT_LAST 40 - -/* If we go past the end of the filter stack, we have a big problem. */ -#define AP_ENOBODY_WROTE (-1) - - -API_EXPORT(ap_filter_t *) ap_init_filter(ap_pool_t *p); - -API_EXPORT(void) ap_hook_filter(HOOK_filter *pf, request_rec *r, - const char * const *aszPre, - const char * const *aszSucc, int nOrder); - -API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *bucket); -API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *data); - -API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, - ap_filter_t *next, - ap_bucket_brigade **data); - -#endif /* ndef(AP_FILTER_H) */ |