*
* 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,
*
* 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.
*/
*
* 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.
*/
* 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
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
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
}
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);
}
}
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) {
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;
}
}
}
-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;