summaryrefslogtreecommitdiffstats
path: root/modules/experimental
diff options
context:
space:
mode:
authorChris Darroch <chrisd@apache.org>2006-10-17 19:25:07 +0200
committerChris Darroch <chrisd@apache.org>2006-10-17 19:25:07 +0200
commitf713a096bd7dab517a56d03ab9e0c9e0f0954ef1 (patch)
treebde97249327ae67d031bc6bed55a88cf7e94faef /modules/experimental
parentAdd a missing include of apr_buckets.h. [Martin Kraemer] (diff)
downloadapache2-f713a096bd7dab517a56d03ab9e0c9e0f0954ef1.tar.xz
apache2-f713a096bd7dab517a56d03ab9e0c9e0f0954ef1.zip
add example test_config routine
re-order config routines to match invocation order git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@464968 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/experimental')
-rw-r--r--modules/experimental/mod_example.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/modules/experimental/mod_example.c b/modules/experimental/mod_example.c
index f296d99f44..ffec07ae1e 100644
--- a/modules/experimental/mod_example.c
+++ b/modules/experimental/mod_example.c
@@ -850,40 +850,55 @@ static int x_check_config(apr_pool_t *pconf, apr_pool_t *plog,
}
/*
- * This routine is called after the server finishes the configuration
- * process. At this point the module may review and adjust its configuration
- * settings in relation to one another and report any problems. On restart,
- * this routine will be called only once, in the running server process.
+ * This routine is called when the -t command-line option is supplied.
+ * It executes only once, in the startup process, after the check_config
+ * phase and just before the process exits. At this point the module
+ * may output any information useful in configuration testing.
+ */
+static void x_test_config(apr_pool_t *pconf, server_rec *s)
+{
+ apr_file_t *out = NULL;
+
+ apr_file_open_stderr(&out, pconf);
+
+ apr_file_printf(out, "Example module configuration test routine\n");
+}
+
+/*
+ * This routine is called to perform any module-specific log file
+ * openings. It is invoked just before the post_config phase
*
* The return value is OK, DECLINED, or HTTP_mumble. If we return OK, the
* server will still call any remaining modules with an handler for this
* phase.
*/
-static int x_post_config(apr_pool_t *pconf, apr_pool_t *plog,
- apr_pool_t *ptemp, server_rec *s)
+static int x_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
+ apr_pool_t *ptemp, server_rec *s)
{
/*
* Log the call and exit.
*/
- trace_add(NULL, NULL, NULL, "x_post_config()");
+ trace_add(s, NULL, NULL, "x_open_logs()");
return OK;
}
/*
- * This routine is called to perform any module-specific log file
- * openings. It is invoked just before the post_config phase
+ * This routine is called after the server finishes the configuration
+ * process. At this point the module may review and adjust its configuration
+ * settings in relation to one another and report any problems. On restart,
+ * this routine will be called only once, in the running server process.
*
* The return value is OK, DECLINED, or HTTP_mumble. If we return OK, the
* server will still call any remaining modules with an handler for this
* phase.
*/
-static int x_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
- apr_pool_t *ptemp, server_rec *s)
+static int x_post_config(apr_pool_t *pconf, apr_pool_t *plog,
+ apr_pool_t *ptemp, server_rec *s)
{
/*
* Log the call and exit.
*/
- trace_add(s, NULL, NULL, "x_open_logs()");
+ trace_add(NULL, NULL, NULL, "x_post_config()");
return OK;
}
@@ -1298,8 +1313,9 @@ static void x_register_hooks(apr_pool_t *p)
{
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_post_config(x_post_config, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_test_config(x_test_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_open_logs(x_open_logs, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_post_config(x_post_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_child_init(x_child_init, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_handler(x_handler, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_quick_handler(x_quick_handler, NULL, NULL, APR_HOOK_MIDDLE);