17#define APR_WANT_STRFUNC
29module AP_MODULE_DECLARE_DATA filter_module;
93 fname,
b->type->name ?
b->type->name :
"(unknown)",
111 "Chaining of FilterProviders not supported");
114 else if (
p->frec->filter_init_func) {
116 if ((
err =
p->frec->filter_init_func(
f)) !=
OK) {
118 "filter_init for %s failed",
p->frec->name);
121 if (
f->ctx !=
NULL) {
144 unsigned int proto_flags;
150 for (provider = filter->
providers; provider; provider = provider->
next) {
151 if (provider->
expr) {
155 "Error evaluating filter dispatch condition: %s",
160 "Expression condition for '%s' %s",
162 match ?
"matched" :
"did not match");
175 "... matched '%s'", *
type);
181 "... did not match '%s'", *
type);
186 "Content-Type condition for '%s' %s",
188 match ?
"matched" :
"did not match");
192 "Content-Type condition for '%s' did not match: "
193 "no Content-Type", provider->
frec->
name);
231 "214 %s Transformation applied",
261 if (
pctx->provider == provider) {
283 if (
f->r->status != 200
294 if (
f->r->proxyreq) {
332 const char *pname,
const char *proto)
334 static const char *
sep =
";, \t";
337 unsigned int flags = 0;
344 return "FilterProtocol: No such filter";
354 for (provider = filter->
providers; provider; provider = provider->
next) {
360 return "FilterProtocol: No such provider for this filter";
436 const char *
fname,
const char *pname,
437 const char *expr,
const char **
types)
475 "Error parsing FilterProvider expression:",
err,
478 provider->
expr = node;
492 const char *
fname,
const char *pname,
527 for (
p = cfg->
chain;
p->next;
p =
p->next) {
529 p->next =
p->next->next;
553 p->next->fname =
arg+1;
574 const char *pname,
const char **
types)
608 const char *rv =
NULL;
610 return "AddOutputFilterByType requires at least two arguments";
653 if (
p->fname ==
NULL)
659 if (filter ==
NULL) {
661 "Unknown filter %s not added",
p->fname);
702 for (
p =
base->chain;
p;
p =
p->next) {
731 else if (add->
chain) {
743 "filter-name [filter-type]"),
745 "filter-name provider-name match-expression"),
747 "list of filter names with optional [+-=!@]"),
749 "filter-name debug-level"),
751 "output filter name followed by one or more content-types"),
754 "filter-name [provider-name] protocol-args"),
int int const char ** match
const char apr_size_t len
APR general purpose library routines.
APR Standard Headers Support.
#define ap_get_module_config(v, m)
#define AP_INIT_TAKE_ARGV(directive, func, mconfig, where, help)
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_ITERATE(directive, func, mconfig, where, help)
#define ap_set_module_config(v, m, val)
#define AP_INIT_TAKE12(directive, func, mconfig, where, help)
#define AP_INIT_TAKE3(directive, func, mconfig, where, help)
#define AP_INIT_TAKE23(directive, func, mconfig, where, help)
#define AP_INIT_TAKE2(directive, func, mconfig, where, help)
#define AP_FILTER_PROTO_CHANGE
#define AP_FILTER_PROTO_NO_BYTERANGE
ap_filter_rec_t * ap_get_output_filter_handle(const char *name)
#define AP_FILTER_PROTO_CHANGE_LENGTH
apr_status_t(* ap_out_filter_func)(ap_filter_t *f, apr_bucket_brigade *b)
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
#define AP_FILTER_PROTO_NO_CACHE
#define AP_FILTER_PROTO_TRANSFORM
ap_filter_t * ap_add_output_filter_handle(ap_filter_rec_t *f, void *ctx, request_rec *r, conn_rec *c)
#define AP_FILTER_PROTO_NO_PROXY
void ap_remove_output_filter(ap_filter_t *f)
void ap_hook_insert_filter(ap_HOOK_insert_filter_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
#define APR_BUCKET_NEXT(e)
#define APR_BRIGADE_SENTINEL(b)
apr_brigade_flush void * ctx
#define APR_BRIGADE_FIRST(b)
const char apr_ssize_t int flags
#define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn)
int ap_expr_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
#define HTTP_INTERNAL_SERVER_ERROR
#define STANDARD20_MODULE_STUFF
char * ap_strcasestr(const char *s1, const char *s2)
#define AP_DEBUG_ASSERT(exp)
const char int apr_pool_t * pool
int strcasecmp(const char *a, const char *b)
#define APR_HASH_KEY_STRING
apr_vformatter_buff_t * c
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb)
static const char * add_filter(cmd_parms *cmd, void *CFG, const char *fname, const char *pname, const char *expr, const char **types)
static const char * filter_bytype1(cmd_parms *cmd, void *CFG, const char *pname, const char **types)
static int filter_init(ap_filter_t *f)
static const char * filter_protocol(cmd_parms *cmd, void *CFG, const char *fname, const char *pname, const char *proto)
static void * filter_config(apr_pool_t *pool, char *x)
static void * filter_merge(apr_pool_t *pool, void *BASE, void *ADD)
static void filter_insert(request_rec *r)
static const char * filter_provider(cmd_parms *cmd, void *CFG, const char *fname, const char *pname, const char *expr)
static const command_rec filter_cmds[]
static void filter_hooks(apr_pool_t *pool)
static const char * filter_chain(cmd_parms *cmd, void *CFG, const char *arg)
static const char * filter_bytype(cmd_parms *cmd, void *CFG, int argc, char *const argv[])
static void filter_trace(conn_rec *c, int debug, const char *fname, apr_bucket_brigade *bb)
static const char * filter_debug(cmd_parms *cmd, void *CFG, const char *fname, const char *level)
static const char * filter_declare(cmd_parms *cmd, void *CFG, const char *fname, const char *place)
static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
static const char *const types[]
static char * place(sed_eval_t *eval, char *asp, char *al1, char *al2)
is a filter provider, as defined and implemented by mod_filter.
ap_filter_provider_t * next
This structure is used for recording information about the registered filters. It associates a name w...
ap_filter_provider_t * providers
ap_init_filter_func filter_init_func
ap_filter_func filter_func
struct ap_filter_rec_t * next
The representation of a filter chain.
Structure to store things which are per connection.
apr_hash_t * live_filters
struct mod_filter_chain * next
ap_filter_provider_t * provider
A structure that represents the current request.
const char * content_type
struct ap_conf_vector_t * request_config
struct ap_conf_vector_t * per_dir_config
apr_table_t * headers_out
ap_out_filter_func out_func