From: Jeff Trawick Date: Thu, 5 Oct 2000 12:01:48 +0000 (+0000) Subject: Now that we have ap_add_input_filter(), rename ap_add_filter() to X-Git-Tag: APACHE_2_0_ALPHA_7~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9a0b56629651ac5ad55228b0d0dd486f6844d16;p=apache Now that we have ap_add_input_filter(), rename ap_add_filter() to ap_add_output_filter(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86401 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/util_filter.h b/include/util_filter.h index 2b4f760590..ea0e447e33 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -149,7 +149,7 @@ typedef apr_status_t (*ap_filter_func)(ap_filter_t *f, ap_bucket_brigade *b); * * The types have a particular sort order, which allows us to insert them * into the filter chain in a determistic order. Within a particular grouping, - * the ordering is equivalent to the order of calls to ap_add_filter(). + * the ordering is equivalent to the order of calls to ap_add_*_filter(). */ typedef enum { AP_FTYPE_CONTENT, @@ -263,8 +263,8 @@ API_EXPORT(apr_status_t) ap_pass_brigade(ap_filter_t *filter, ap_bucket_brigade * * This function is used to register an input filter with the system. * After this registration is performed, then a filter may be added - * into the filter chain by using ap_add_filter() and simply specifying - * the name. + * into the filter chain by using ap_add_input_filter() and simply + * specifying the name. * * The filter's callback and type should be passed. */ @@ -284,8 +284,8 @@ API_EXPORT(void) ap_register_input_filter(const char *name, * * This function is used to register an output filter with the system. * After this registration is performed, then a filter may be added - * into the filter chain by using ap_add_filter() and simply specifying - * the name. + * into the filter chain by using ap_add_output_filter() and simply + * specifying the name. * * The filter's callback and type should be passed. */ @@ -329,11 +329,13 @@ API_EXPORT(void) ap_add_input_filter(const char *name, void *ctx, conn_rec *r); * Add a filter to the current request. Filters are added in a FIFO manner. * The first filter added will be the first filter called. * @param name The name of the filter to add - * @param r The request to add this filter for. - * @deffunc void ap_add_filter(const char *name, request_rec *r) + * @param ctx Context data to set in the filter + * @param r The request to add this filter for (or NULL if it isn't associated with a request) + * @param c The connection to add this filter for + * @deffunc void ap_add_output_filter(const char *name, void *ctx, request_rec *r, conn_rec *c) */ -API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r, - conn_rec *c); +API_EXPORT(void) ap_add_output_filter(const char *name, void *ctx, + request_rec *r, conn_rec *c); /* The next two filters are for abstraction purposes only. They could be * done away with, but that would require that we break modules if we ever diff --git a/modules/experimental/mod_charset_lite.c b/modules/experimental/mod_charset_lite.c index 83994fb8e9..992c42220d 100644 --- a/modules/experimental/mod_charset_lite.c +++ b/modules/experimental/mod_charset_lite.c @@ -109,7 +109,8 @@ typedef struct charset_dir_t { int debug; const char *charset_source; /* source encoding */ const char *charset_default; /* how to ship on wire */ - enum {IA_INIT, IA_IMPADD, IA_NOIMPADD} implicit_add; /* tmp hack! module does ap_add_filter()? */ + /** module does ap_add_*_filter()? */ + enum {IA_INIT, IA_IMPADD, IA_NOIMPADD} implicit_add; } charset_dir_t; /* charset_filter_ctx_t is created for each filter instance; because the same @@ -366,14 +367,15 @@ static void xlate_insert_filter(request_rec *r) if (reqinfo && dc->implicit_add == IA_IMPADD && reqinfo->output_ctx) { - ap_add_filter(XLATEOUT_FILTER_NAME, reqinfo->output_ctx, r, r->connection); + ap_add_output_filter(XLATEOUT_FILTER_NAME, reqinfo->output_ctx, r, + r->connection); } #ifdef NOT_YET /* no input filters yet; we still rely on BUFF */ if (reqinfo && dc->implicit_add == IA_IMPADD && reqinfo->input_ctx) { - /* ap_add_filter(XLATEIN_FILTER_NAME, reqinfo->input_ctx, r); */ + /* ap_add_input_filter(XLATEIN_FILTER_NAME, reqinfo->input_ctx, r); */ } #endif } diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 7e5d63f325..9fe6a97c68 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -3434,7 +3434,7 @@ static void core_register_filter(request_rec *r) for (i = 0; i < conf->filters->nelts; i++) { char *foobar = items[i]; - ap_add_filter(foobar, NULL, r, r->connection); + ap_add_output_filter(foobar, NULL, r, r->connection); } } diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 639d04b7f4..7ee84088c5 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2099,8 +2099,8 @@ API_EXPORT(void) ap_send_http_header(request_rec *r) if (r->chunked) { apr_table_mergen(r->headers_out, "Transfer-Encoding", "chunked"); apr_table_unset(r->headers_out, "Content-Length"); - ap_add_filter("BUFFER", NULL, r, r->connection); - ap_add_filter("CHUNK", NULL, r, r->connection); + ap_add_output_filter("BUFFER", NULL, r, r->connection); + ap_add_output_filter("CHUNK", NULL, r, r->connection); } if (r->byterange > 1) { diff --git a/server/connection.c b/server/connection.c index 3eb453761f..e4dd226eba 100644 --- a/server/connection.c +++ b/server/connection.c @@ -217,7 +217,7 @@ CORE_EXPORT(void) ap_process_connection(conn_rec *c) int ap_pre_http_connection(conn_rec *c) { ap_add_input_filter("CORE_IN", NULL, c); - ap_add_filter("CORE", NULL, NULL, c); + ap_add_output_filter("CORE", NULL, NULL, c); return OK; } diff --git a/server/util_filter.c b/server/util_filter.c index f95532b6aa..1d26b8e194 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -148,8 +148,8 @@ API_EXPORT(void) ap_add_input_filter(const char *name, void *ctx, conn_rec *c) } } -API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r, - conn_rec *c) +API_EXPORT(void) ap_add_output_filter(const char *name, void *ctx, + request_rec *r, conn_rec *c) { ap_filter_rec_t *frec = registered_output_filters;