summaryrefslogtreecommitdiffstats
path: root/modules/examples
diff options
context:
space:
mode:
Diffstat (limited to 'modules/examples')
-rw-r--r--modules/examples/mod_case_filter_in.c2
-rw-r--r--modules/examples/mod_example_hooks.c26
2 files changed, 23 insertions, 5 deletions
diff --git a/modules/examples/mod_case_filter_in.c b/modules/examples/mod_case_filter_in.c
index 5116e3b..c70a9eb 100644
--- a/modules/examples/mod_case_filter_in.c
+++ b/modules/examples/mod_case_filter_in.c
@@ -114,7 +114,7 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f,
buf[n] = apr_toupper(data[n]);
}
- pbktOut = apr_bucket_heap_create(buf, len, 0, c->bucket_alloc);
+ pbktOut = apr_bucket_heap_create(buf, len, free, c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(pbbOut, pbktOut);
apr_bucket_delete(pbktIn);
}
diff --git a/modules/examples/mod_example_hooks.c b/modules/examples/mod_example_hooks.c
index d818dc1..f7ef5a5 100644
--- a/modules/examples/mod_example_hooks.c
+++ b/modules/examples/mod_example_hooks.c
@@ -742,7 +742,7 @@ static int x_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
/*
* Log the call and exit.
*/
- trace_startup(ptemp, NULL, NULL, "x_pre_config()");
+ trace_startup(pconf, NULL, NULL, "x_pre_config()");
return OK;
}
@@ -763,7 +763,7 @@ static int x_check_config(apr_pool_t *pconf, apr_pool_t *plog,
/*
* Log the call and exit.
*/
- trace_startup(ptemp, s, NULL, "x_check_config()");
+ trace_startup(pconf, s, NULL, "x_check_config()");
return OK;
}
@@ -800,7 +800,7 @@ static int x_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
/*
* Log the call and exit.
*/
- trace_startup(ptemp, s, NULL, "x_open_logs()");
+ trace_startup(pconf, s, NULL, "x_open_logs()");
return OK;
}
@@ -820,7 +820,7 @@ static int x_post_config(apr_pool_t *pconf, apr_pool_t *plog,
/*
* Log the call and exit.
*/
- trace_startup(ptemp, s, NULL, "x_post_config()");
+ trace_startup(pconf, s, NULL, "x_post_config()");
return OK;
}
@@ -1175,6 +1175,22 @@ static int x_post_read_request(request_rec *r)
/*
* This routine gives our module an opportunity to translate the URI into an
+ * actual filename, before URL decoding happens.
+ *
+ * This is a RUN_FIRST hook.
+ */
+static int x_pre_translate_name(request_rec *r)
+{
+ /*
+ * We don't actually *do* anything here, except note the fact that we were
+ * called.
+ */
+ trace_request(r, "x_pre_translate_name()");
+ return DECLINED;
+}
+
+/*
+ * This routine gives our module an opportunity to translate the URI into an
* actual filename. If we don't do anything special, the server's default
* rules (Alias directives and the like) will continue to be followed.
*
@@ -1448,6 +1464,7 @@ static int x_monitor(apr_pool_t *p, server_rec *s)
*/
static void x_register_hooks(apr_pool_t *p)
{
+ trace = NULL;
ap_hook_pre_config(x_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_check_config(x_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_test_config(x_test_config, NULL, NULL, APR_HOOK_MIDDLE);
@@ -1466,6 +1483,7 @@ static void x_register_hooks(apr_pool_t *p)
ap_hook_log_transaction(x_log_transaction, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_http_scheme(x_http_scheme, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_default_port(x_default_port, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_pre_translate_name(x_pre_translate_name, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_translate_name(x_translate_name, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_map_to_storage(x_map_to_storage, NULL,NULL, APR_HOOK_MIDDLE);
ap_hook_header_parser(x_header_parser, NULL, NULL, APR_HOOK_MIDDLE);