Пример #1
0
void h2_task_register_hooks(void)
{
    /* This hook runs on new connections before mod_ssl has a say.
     * Its purpose is to prevent mod_ssl from touching our pseudo-connections
     * for streams.
     */
    ap_hook_pre_connection(h2_task_pre_conn,
                           NULL, mod_ssl, APR_HOOK_FIRST);
    /* When the connection processing actually starts, we might 
     * take over, if the connection is for a task.
     */
    ap_hook_process_connection(h2_task_process_conn, 
                               NULL, NULL, APR_HOOK_FIRST);

    ap_register_input_filter("H2_SLAVE_IN", h2_filter_slave_in,
                             NULL, AP_FTYPE_NETWORK);
    ap_register_output_filter("H2_SLAVE_OUT", h2_filter_slave_output,
                              NULL, AP_FTYPE_NETWORK);
    ap_register_output_filter("H2_PARSE_H1", h2_filter_parse_h1,
                              NULL, AP_FTYPE_NETWORK);

    ap_register_input_filter("H2_REQUEST", h2_filter_request_in,
                             NULL, AP_FTYPE_PROTOCOL);
    ap_register_output_filter("H2_RESPONSE", h2_filter_headers_out,
                              NULL, AP_FTYPE_PROTOCOL);
    ap_register_output_filter("H2_TRAILERS_OUT", h2_filter_trailers_out,
                              NULL, AP_FTYPE_PROTOCOL);
}
Пример #2
0
/* Implements the #register_hooks method of Apache's #module vtable. */
static void
register_hooks(apr_pool_t *pconf)
{
  ap_hook_pre_config(init_dso, NULL, NULL, APR_HOOK_REALLY_FIRST);
  ap_hook_post_config(init, NULL, NULL, APR_HOOK_MIDDLE);

  /* our provider */
  dav_register_provider(pconf, "svn", &provider);

  /* input filter to read MERGE bodies. */
  ap_register_input_filter("SVN-MERGE", merge_xml_in_filter, NULL,
                           AP_FTYPE_RESOURCE);
  ap_hook_insert_filter(merge_xml_filter_insert, NULL, NULL,
                        APR_HOOK_MIDDLE);

  /* general request handler for methods which mod_dav DECLINEs. */
  ap_hook_handler(dav_svn__handler, NULL, NULL, APR_HOOK_LAST);

  /* live property handling */
  dav_hook_gather_propsets(dav_svn__gather_propsets, NULL, NULL,
                           APR_HOOK_MIDDLE);
  dav_hook_find_liveprop(dav_svn__find_liveprop, NULL, NULL, APR_HOOK_MIDDLE);
  dav_hook_insert_all_liveprops(dav_svn__insert_all_liveprops, NULL, NULL,
                                APR_HOOK_MIDDLE);
  dav_register_liveprop_group(pconf, &dav_svn__liveprop_group);

  /* Proxy / mirroring filters and fixups */
  ap_register_output_filter("LocationRewrite", dav_svn__location_header_filter,
                            NULL, AP_FTYPE_CONTENT_SET);
  ap_register_output_filter("ReposRewrite", dav_svn__location_body_filter,
                            NULL, AP_FTYPE_CONTENT_SET);
  ap_register_input_filter("IncomingRewrite", dav_svn__location_in_filter,
                           NULL, AP_FTYPE_CONTENT_SET);
  ap_hook_fixups(dav_svn__proxy_request_fixup, NULL, NULL, APR_HOOK_MIDDLE);
}
Пример #3
0
static void register_hooks(apr_pool_t *p)
{
    ap_hook_post_config(http_post_config, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_process_connection(ap_process_http_connection, NULL, NULL,
                               APR_HOOK_REALLY_LAST);
    ap_hook_map_to_storage(ap_send_http_trace,NULL,NULL,APR_HOOK_MIDDLE);
    ap_hook_map_to_storage(http_send_options,NULL,NULL,APR_HOOK_MIDDLE);
    ap_hook_http_scheme(http_scheme,NULL,NULL,APR_HOOK_REALLY_LAST);
    ap_hook_default_port(http_port,NULL,NULL,APR_HOOK_REALLY_LAST);
    ap_hook_create_request(http_create_request, NULL, NULL, APR_HOOK_REALLY_LAST);
    ap_http_input_filter_handle =
        ap_register_input_filter("HTTP_IN", ap_http_filter,
                                 NULL, AP_FTYPE_PROTOCOL);
    ap_http_header_filter_handle =
        ap_register_output_filter("HTTP_HEADER", ap_http_header_filter,
                                  NULL, AP_FTYPE_PROTOCOL);
    ap_chunk_filter_handle =
        ap_register_output_filter("CHUNK", ap_http_chunk_filter,
                                  NULL, AP_FTYPE_TRANSCODE);
    ap_http_outerror_filter_handle =
        ap_register_output_filter("HTTP_OUTERROR", ap_http_outerror_filter,
                                  NULL, AP_FTYPE_PROTOCOL);
    ap_byterange_filter_handle =
        ap_register_output_filter("BYTERANGE", ap_byterange_filter,
                                  NULL, AP_FTYPE_PROTOCOL);
    ap_method_registry_init(p);
}
Пример #4
0
void h2_task_register_hooks(void)
{
    /* This hook runs on new connections before mod_ssl has a say.
     * Its purpose is to prevent mod_ssl from touching our pseudo-connections
     * for streams.
     */
    ap_hook_pre_connection(h2_task_pre_conn,
                           NULL, mod_ssl, APR_HOOK_FIRST);
    /* When the connection processing actually starts, we might to
     * take over, if the connection is for a task.
     */
    ap_hook_process_connection(h2_task_process_conn, 
                               NULL, NULL, APR_HOOK_FIRST);

    ap_register_output_filter("H2_RESPONSE", h2_response_output_filter,
                              NULL, AP_FTYPE_PROTOCOL);
    ap_register_input_filter("H2_TO_H1", h2_filter_stream_input,
                             NULL, AP_FTYPE_NETWORK);
    ap_register_output_filter("H1_TO_H2", h2_filter_stream_output,
                              NULL, AP_FTYPE_NETWORK);
    ap_register_output_filter("H1_TO_H2_RESP", h2_filter_read_response,
                              NULL, AP_FTYPE_PROTOCOL);
    ap_register_output_filter("H2_TRAILERS", h2_response_trailers_filter,
                              NULL, AP_FTYPE_PROTOCOL);
}
Пример #5
0
static void headerfilter_register_hooks(apr_pool_t *p)
{
    ap_hook_insert_filter(InsertFilter_res,NULL,NULL,APR_HOOK_MIDDLE);
    ap_hook_insert_filter(InsertFilter_con,NULL,NULL,APR_HOOK_LAST);
    ap_hook_insert_filter(InsertFilter_pro,NULL,NULL,APR_HOOK_LAST);
    ap_register_output_filter("RES" ,res_filter, NULL, AP_FTYPE_RESOURCE);
    ap_register_output_filter("PRO", pro_filter, NULL, AP_FTYPE_PROTOCOL);
    ap_register_output_filter("CON", con_filter, NULL, AP_FTYPE_CONTENT_SET);
}
Пример #6
0
void h2_task_register_hooks(void)
{
    ap_register_output_filter("H2_RESPONSE", h2_response_output_filter,
                              NULL, AP_FTYPE_PROTOCOL);
    ap_register_input_filter("H2_TO_H1", h2_filter_stream_input,
                             NULL, AP_FTYPE_NETWORK);
    ap_register_output_filter("H1_TO_H2", h2_filter_stream_output,
                              NULL, AP_FTYPE_NETWORK);
    ap_register_output_filter("H1_TO_H2_RESP", h2_filter_read_response,
                              NULL, AP_FTYPE_PROTOCOL);
}
Пример #7
0
static void register_hooks (apr_pool_t *p)
{
    (void)p;
    ap_register_output_filter(filter_name, apreq_output_filter_test,
                              apreq_output_filter_test_init,
                              AP_FTYPE_CONTENT_SET);
}
Пример #8
0
static void charset_register_hooks(apr_pool_t *p)
{
    ap_hook_fixups(find_code_page, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_insert_filter(xlate_insert_filter, NULL, NULL, APR_HOOK_REALLY_LAST);
    ap_register_output_filter(XLATEOUT_FILTER_NAME, xlate_out_filter, NULL,
                              AP_FTYPE_RESOURCE);
    ap_register_input_filter(XLATEIN_FILTER_NAME, xlate_in_filter, NULL,
                             AP_FTYPE_RESOURCE);
}
Пример #9
0
/* Implements the #register_hooks method of Apache's #module vtable. */
static void
register_hooks(apr_pool_t *pconf)
{
  ap_hook_pre_config(init_dso, NULL, NULL, APR_HOOK_REALLY_FIRST);
  ap_hook_post_config(init, NULL, NULL, APR_HOOK_MIDDLE);

  /* our provider */
  dav_register_provider(pconf, "svn", &provider);

  /* input filter to read MERGE bodies. */
  ap_register_input_filter("SVN-MERGE", merge_xml_in_filter, NULL,
                           AP_FTYPE_RESOURCE);
  ap_hook_insert_filter(merge_xml_filter_insert, NULL, NULL,
                        APR_HOOK_MIDDLE);

  /* general request handler for methods which mod_dav DECLINEs. */
  ap_hook_handler(dav_svn__handler, NULL, NULL, APR_HOOK_LAST);

  /* Handler to GET Subversion's FSFS cache stats, a bit like mod_status. */
  ap_hook_handler(dav_svn__status, NULL, NULL, APR_HOOK_MIDDLE);

  /* live property handling */
  dav_hook_gather_propsets(dav_svn__gather_propsets, NULL, NULL,
                           APR_HOOK_MIDDLE);
  dav_hook_find_liveprop(dav_svn__find_liveprop, NULL, NULL, APR_HOOK_MIDDLE);
  dav_hook_insert_all_liveprops(dav_svn__insert_all_liveprops, NULL, NULL,
                                APR_HOOK_MIDDLE);
  dav_register_liveprop_group(pconf, &dav_svn__liveprop_group);

  /* Proxy / mirroring filters and fixups */
  ap_register_output_filter("LocationRewrite", dav_svn__location_header_filter,
                            NULL, AP_FTYPE_CONTENT_SET);
  ap_register_output_filter("ReposRewrite", dav_svn__location_body_filter,
                            NULL, AP_FTYPE_CONTENT_SET);
  ap_register_input_filter("IncomingRewrite", dav_svn__location_in_filter,
                           NULL, AP_FTYPE_CONTENT_SET);
  ap_hook_fixups(dav_svn__proxy_request_fixup, NULL, NULL, APR_HOOK_MIDDLE);
  /* translate_name hook is LAST so that it doesn't interfere with modules
   * like mod_alias that are MIDDLE. */
  ap_hook_translate_name(dav_svn__translate_name, NULL, NULL, APR_HOOK_LAST);
  /* map_to_storage hook is LAST to avoid interferring with mod_http's
   * handling of OPTIONS and TRACE. */
  ap_hook_map_to_storage(dav_svn__map_to_storage, NULL, NULL, APR_HOOK_LAST);
}
Пример #10
0
/**
 * Main entry point.
 */
static void mod_sslhaf_register_hooks(apr_pool_t *p) {
    static const char * const afterme[] = { "mod_security2.c", NULL };

    ap_hook_pre_connection(mod_sslhaf_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_post_read_request(mod_sslhaf_post_request, NULL, afterme, APR_HOOK_REALLY_FIRST);

    ap_register_input_filter(mod_sslhaf_in_filter_name, mod_sslhaf_in_filter,
        NULL, AP_FTYPE_NETWORK - 1);
    ap_register_output_filter(mod_sslhaf_out_filter_name, mod_sslhaf_out_filter,
        NULL, AP_FTYPE_NETWORK - 1);
}
static void register_hooks(apr_pool_t *p)
{
    static const char *pre[] = { "mod_log_config.c", NULL };

    ap_hook_pre_connection(firstbyte_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_pre_config(firstbyte_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
    ap_hook_post_read_request(firstbyte_post_req, NULL, NULL, APR_HOOK_LAST);

    ap_register_output_filter(firstbyte_filter_name, firstbyte_out_filter, NULL,
								AP_FTYPE_NETWORK - 1);
}
Пример #12
0
// Register every module handlers
void psm_hooks_register(apr_pool_t *p)
{
    // after the configuration ...
    ap_hook_post_config(psm_initialize, NULL, NULL, APR_HOOK_LAST);

    // before each request processing ...
    ap_hook_handler(psm_input_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);

    // register filter and add it in a insert_filter handler
    ap_register_output_filter(PSM_OUTPUT_FILTER_NAME, psm_output_filter, NULL, AP_FTYPE_RESOURCE);
    ap_hook_insert_filter(psm_insert_output_filter, NULL, NULL, APR_HOOK_MIDDLE);
}
Пример #13
0
static void dumpio_register_hooks(apr_pool_t *p)
{
/*
 * We know that SSL is CONNECTION + 5
 */
  ap_register_output_filter("DUMPIO_OUT", dumpio_output_filter,
	NULL, AP_FTYPE_CONNECTION + 3) ;

  ap_register_input_filter("DUMPIO_IN", dumpio_input_filter,
	NULL, AP_FTYPE_CONNECTION + 3) ;

  ap_hook_pre_connection(dumpio_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
}
Пример #14
0
static void xsendfile_register_hooks(apr_pool_t *p) {
  ap_register_output_filter(
    "XSENDFILE",
    ap_xsendfile_output_filter,
    NULL,
    AP_FTYPE_CONTENT_SET
    );

  ap_hook_insert_filter(
    ap_xsendfile_insert_output_filter,
    NULL,
    NULL,
    APR_HOOK_LAST + 1
    );
}
Пример #15
0
/**
 * Registers the hooks for this module.
 *
 * @param p the pool to allocate from, if necessary.
 */
static void fsp_register_hooks(apr_pool_t* p)
{
   // registers the pre-connection hook to handle adding filters
   ap_hook_pre_connection(
      fsp_pre_connection, NULL, NULL, APR_HOOK_MIDDLE);

   // will parse a policy file request, to be added in pre_connection
   ap_register_input_filter(
      "fsp_request", fsp_input_filter,
      NULL, AP_FTYPE_CONNECTION);

   // will emit a cross-domain policy response to be added in pre_connection
   ap_register_output_filter(
      "fsp_response", fsp_output_filter,
      NULL, AP_FTYPE_CONNECTION);
}
Пример #16
0
/*
	Definition of MOD_BUT hooks. This is parsed by httpd during startup
	and the symbols are loaded into the httpd core. 
*/
static void mod_but_register_hooks (apr_pool_t *p)
{
	static const char * const cfgPost[]={ "http_core.c", NULL };
  	ap_hook_post_config(mod_but_shm_initialize, NULL, cfgPost, APR_HOOK_MIDDLE);
	ap_hook_post_config(mod_but_shm_initialize_history, NULL, cfgPost, APR_HOOK_MIDDLE);
	ap_hook_post_config(mod_but_shm_initialize_cookiestore, NULL, cfgPost, APR_HOOK_MIDDLE);
	ap_hook_access_checker(but_access, NULL, NULL, APR_HOOK_FIRST);

//	ap_register_input_filter("MOD_BUT_IN", mod_but_input_filter, NULL, AP_FTYPE_CONTENT_SET);
//	ap_hook_insert_filter(mod_but_insert_input_filter, NULL, NULL, APR_HOOK_FIRST);

	ap_register_output_filter("MOD_BUT_OUT", mod_but_output_filter, NULL, AP_FTYPE_CONTENT_SET);
	ap_hook_insert_filter(mod_but_insert_output_filter, NULL, NULL, APR_HOOK_LAST);


}
Пример #17
0
/*
 * Register additional hooks.
 */
static void
but_register_hooks(apr_pool_t *p)
{
	static const char * const cfgPost[] = { "http_core.c", NULL };

	ap_hook_post_config(but_post_config, NULL, cfgPost, APR_HOOK_MIDDLE);
	ap_hook_child_init(but_child_init, NULL, NULL, APR_HOOK_MIDDLE);
	ap_hook_access_checker(but_access_checker, NULL, NULL, APR_HOOK_FIRST);

#if 0
	ap_register_input_filter("MOD_BUT_IN", mod_but_input_filter, NULL, AP_FTYPE_CONTENT_SET);
	ap_hook_insert_filter(mod_but_insert_input_filter, NULL, NULL, APR_HOOK_FIRST);
#endif

	ap_register_output_filter("MOD_BUT_OUT", but_output_filter, NULL, AP_FTYPE_CONTENT_SET);
	ap_hook_insert_filter(but_insert_output_filter, NULL, NULL, APR_HOOK_LAST);
}
Пример #18
0
/**
 * @internal
 *
 * Register functions to handle filters and hooks.
 */
static void ironbee_register_hooks(apr_pool_t *p)
{
    /* Other modules:
     *   mod_ssl       = AP_FTYPE_CONNECTION + 5
     *   mod_expires   = AP_FTYPE_CONTENT_SET - 2
     *   mod_cache     = AP_FTYPE_CONTENT_SET - 1
     *   mod_deflate   = AP_FTYPE_CONTENT_SET - 1
     *   mod_headers   = AP_FTYPE_CONTENT_SET
     */

    ap_register_input_filter(
        "IRONBEE_IN",
        ironbee_input_filter,
        NULL,
        AP_FTYPE_CONNECTION + 1
    );

#ifdef IB_DEBUG
    ap_register_input_filter(
        "IRONBEE_DBG_IN",
        ironbee_dbg_input_filter,
        NULL,
        AP_FTYPE_CONNECTION
    );
#endif

    ap_register_output_filter(
        "IRONBEE_OUT",
        ironbee_output_filter,
        NULL,
        AP_FTYPE_CONNECTION
    );

    ap_hook_child_init(ironbee_child_init,
                       NULL, NULL,
                       APR_HOOK_FIRST);

    ap_hook_post_config(ironbee_post_config,
                        NULL, NULL,
                        APR_HOOK_MIDDLE);

    ap_hook_pre_connection(ironbee_pre_connection,
                           NULL, NULL,
                           APR_HOOK_LAST);
}
Пример #19
0
static void register_hooks(apr_pool_t *p)
{
    TRACER;
    // inline code in httpd.conf
    ap_hook_handler(mod_mruby_handler_inline, NULL, NULL, APR_HOOK_MIDDLE);
    //ap_hook_translate_name(mod_mruby_translate_name_first_inline, NULL, NULL, APR_HOOK_FIRST);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(handler);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(post_read_request);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(translate_name);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(map_to_storage);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(access_checker);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(check_user_id);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(auth_checker);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(fixups);
    MOD_MRUBY_SET_ALL_REGISTER_INLINE(log_transaction);

    // hook script file
    ap_hook_pre_config(mod_mruby_preinit, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_post_config(mod_mruby_init, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_child_init(mod_mruby_child_init, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_handler(mod_mruby_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
    MOD_MRUBY_SET_ALL_REGISTER(handler);
    MOD_MRUBY_SET_ALL_REGISTER(child_init);
    MOD_MRUBY_SET_ALL_REGISTER(post_read_request);
    MOD_MRUBY_SET_ALL_REGISTER(quick_handler);
    MOD_MRUBY_SET_ALL_REGISTER(translate_name);
    MOD_MRUBY_SET_ALL_REGISTER(map_to_storage);
    MOD_MRUBY_SET_ALL_REGISTER(access_checker);
    MOD_MRUBY_SET_ALL_REGISTER(check_user_id);
    MOD_MRUBY_SET_ALL_REGISTER(auth_checker);
    MOD_MRUBY_SET_ALL_REGISTER(fixups);
    MOD_MRUBY_SET_ALL_REGISTER(insert_filter);
    MOD_MRUBY_SET_ALL_REGISTER(log_transaction);

    ap_register_provider(p, AUTHN_PROVIDER_GROUP, "mruby", "0", &authn_mruby_provider);
    ap_register_output_filter("mruby", mod_mruby_output_filter, NULL, AP_FTYPE_CONTENT_SET);
    //ap_register_input_filter( "MODMRUBYFILTER", mod_mruby_input_filter,  NULL, AP_FTYPE_CONTENT_SET);
}
Пример #20
0
/* Apace Register Hooks */
static void mod_track_register_hooks (apr_pool_t *p){

	//Worth trying this -
	//ap_hook_quick_handler -    called before any request processing, used by cache modules.
       
	//After accepting connection
	ap_hook_pre_connection(log_pre_conn,NULL,NULL,APR_HOOK_FIRST);
 
	//Post request read
	ap_hook_post_read_request(log_post_conn,NULL,NULL,APR_HOOK_LAST);

	//header parser
	ap_hook_header_parser(log_header_parser, NULL, NULL, APR_HOOK_MIDDLE);

	//Hook before output is sent
	log_output_start_handle = ap_register_output_filter("MOD_TRACK",
                                  log_output_start,
                                  NULL,
                                  AP_FTYPE_CONTENT_SET+1);
 
	//cleanup handler
	ap_hook_access_checker(cleanup_handler, NULL, NULL, APR_HOOK_LAST);

}
Пример #21
0
static void compile_register_hooks(apr_pool_t *pool) {
  ap_hook_insert_filter(ap_compile_add_output_filter, NULL, NULL, APR_HOOK_MIDDLE);
  ap_register_output_filter("COMPILE", ap_compile_output_filter, NULL, AP_FTYPE_RESOURCE);
}
Пример #22
0
static void register_hooks(apr_pool_t *pool)
{
    ap_register_output_filter(substitute_filter_name, substitute_filter,
                              NULL, AP_FTYPE_RESOURCE);
}
Пример #23
0
static void register_hooks(apr_pool_t *p)
{
    /* run after mod_deflate etc etc, but not at connection level, ie, mod_ssl. */
    ap_register_output_filter(RATE_LIMIT_FILTER_NAME, rate_limit_filter,
                              NULL, AP_FTYPE_PROTOCOL + 3);
}
/**************************************************
 * register module hook
 **************************************************/
static void register_hooks(apr_pool_t *p)
{
    ap_register_output_filter("MEMCOOKIE_SINK", memcookie_sink_filter, NULL, AP_FTYPE_CONTENT_SET + 1);
    ap_hook_check_user_id(Auth_memCookie_check_cookie, NULL, NULL, APR_HOOK_FIRST);
}
Пример #25
0
static void fauth_register_hooks(apr_pool_t *p) {
	ap_hook_insert_filter(fauth_output_filter_hook, NULL, NULL, APR_HOOK_LAST);
	ap_hook_insert_error_filter(fauth_output_filter_hook, NULL, NULL, APR_HOOK_REALLY_LAST);
	ap_register_output_filter("fauth_filter", fauth_output_filter, NULL, AP_FTYPE_RESOURCE);
}
Пример #26
0
static void register_hooks(apr_pool_t * pool)
{
    ap_register_output_filter(triger_filter_name,
			      triger_filter, NULL, AP_FTYPE_RESOURCE);
}
Пример #27
0
/* Register the filter function as a filter for modifying the HTTP body (content) */
static void idlChunkRegisterHook(apr_pool_t *pool) {
  ap_register_output_filter("IDLCHUNK", idlChunkHandler, NULL, AP_FTYPE_CONTENT_SET);
}
Пример #28
0
/**
 * Gets called whenever there is a "ReplaceFilterDefine" line in the config
 * file. The method creates a new configuration (replace_filter_t) for the
 * server (available through cmd->server). Returns an error message if things
 * didn't work out.
 *
 * @param cmd   The command record that holds the general data for the
 *              environment.
 * @param dummy To be ignored.
 * @param args  The arguments from the filter definition (everything following
 *              ReplaceFilterDefine.
 * @see cmd_parms 
 */
static const char *define_filter(cmd_parms *cmd, void *dummy, const char *args)
{
    replace_server_t *conf = ap_get_module_config(cmd->server->module_config,
                                             &replace_module);
    const char *token;
    const char *name;
    replace_filter_t *filter;

    /* Extract the name of the filter. */
    name = ap_getword_white(cmd->pool, &args);
    if (!name) {
        return "Filter name not found";
    }

    /* Check if there is another filter by the same name. */
    if (apr_hash_get(conf->h, name, APR_HASH_KEY_STRING)) {
        return apr_psprintf(cmd->pool, "Replace Filter %s is already defined",
                            name);
    }
    
    /* Create a new filter configuration and populate the filter configuration 
     * with default values.
     */
    filter = (replace_filter_t *)apr_pcalloc(conf->p, sizeof(replace_filter_t));
    filter->name = name;
    filter->mode = OUTPUT_FILTER;
    filter->ftype = AP_FTYPE_RESOURCE;
    filter->pattern = NULL;
    filter->case_ignore = 0;
    apr_hash_set(conf->h, name, APR_HASH_KEY_STRING, filter);

    /* Parse the remaining arguments. */
    while (*args) {
        /* Ignore whitespaces. */
        while (apr_isspace(*args)) {
            ++args;
        }

        /* Set the filter mode. */
        if (!strncasecmp(args, "mode=", 5)) {
            args += 5;
            token = ap_getword_white(cmd->pool, &args);
            if (!strcasecmp(token, "output")) {
                filter->mode = OUTPUT_FILTER;
            }
            else if (!strcasecmp(token, "input")) {
                filter->mode = INPUT_FILTER;
            }
            else {
                return apr_psprintf(cmd->pool, "Invalid mode: `%s'",
                                    token);
            }
            continue;
        }

        /* Set the filter type. */
        if (!strncasecmp(args, "ftype=", 6)) {
            args += 6;
            token = ap_getword_white(cmd->pool, &args);
            filter->ftype = atoi(token);
            continue;
        }

        /* MIME type for incoming data. */
        if (!strncasecmp(args, "intype=", 7)) {
            args += 7;
            filter->intype = ap_getword_white(cmd->pool, &args);
            continue;
        }

        /* MIME type for outgoing data, if different from intype. */
        if (!strncasecmp(args, "outtype=", 8)) {
            args += 8;
            filter->outtype = ap_getword_white(cmd->pool, &args);
            continue;
        }

        /* check if the regular expression is to be handled case sensitive or
         * not.
         */
        if (!strncasecmp(args, "caseignore", 10)) {
            token = ap_getword_white(cmd->pool, &args);
            if (!strncasecmp(token, "caseignore", 10)) {
                filter->case_ignore = 1;
            } else {
                return apr_psprintf(cmd->pool, "mangled argument `%s'",
                                    token);
            }
            continue;
        }
        
        /* If there is any other argument than the already checked ones, return
         * with an error message.
         */
        return apr_psprintf(cmd->pool, "Unexpected parameter: `%s'",
                            args);
    }

    /* parsing is done...  register the filter 
     */
    if (filter->mode == OUTPUT_FILTER) {
        /* XXX need a way to ensure uniqueness among all filters */
        if (!ap_register_output_filter(filter->name, replace_output_filter, 
                                       NULL, filter->ftype)) {
            return apr_psprintf(cmd->pool, 
                                "Unable to register output filter '%s'",
                                filter->name);
        }
    }
    else {
        ap_assert(1 != 1); /* we set the field wrong somehow */
    }

    return NULL;
}
//------- 
static void register_hooks(apr_pool_t *p){ 
    ap_register_output_filter(module_name, out_filter, NULL, 
                              AP_FTYPE_CONTENT_SET); 
} 
static void register_hooks(apr_pool_t *p)
{
  ap_hook_check_user_id(check_auth_handler, NULL, NULL, APR_HOOK_MIDDLE);
  ap_hook_auth_checker(break_request_handler, NULL, NULL, APR_HOOK_MIDDLE);
  ap_register_output_filter(DUMP_AUTH_RESULT, auth_result_dump_filter, NULL, AP_FTYPE_CONTENT_SET);
}