summaryrefslogtreecommitdiffstats
path: root/modules/mappers/mod_dir.c
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2001-02-21 18:54:41 +0100
committerRyan Bloom <rbb@apache.org>2001-02-21 18:54:41 +0100
commit36c56ce7222874fbf37a1cefac862f4dcd8e49ff (patch)
treef31e6264dabcff86e0740a80dad8736df062804b /modules/mappers/mod_dir.c
parentRemove mod_proxy from the Windows project file (diff)
downloadapache2-36c56ce7222874fbf37a1cefac862f4dcd8e49ff.tar.xz
apache2-36c56ce7222874fbf37a1cefac862f4dcd8e49ff.zip
Split the mod_dir fixup into two parts. The first determines if this
is a MOVED_PERMANANTLY response, and is done from the fixup. The second is a handler that redirects to an index.html page. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88263 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--modules/mappers/mod_dir.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c
index 1293bd654a..4c4be62239 100644
--- a/modules/mappers/mod_dir.c
+++ b/modules/mappers/mod_dir.c
@@ -116,13 +116,9 @@ static void *merge_dir_configs(apr_pool_t *p, void *basev, void *addv)
return new;
}
-static int handle_dir(request_rec *r)
+static int fixup_dir(request_rec *r)
{
dir_config_rec *d;
- char *dummy_ptr[1];
- char **names_ptr;
- int num_names;
- int error_notfound = 0;
if (r->finfo.filetype != APR_DIR) {
return DECLINED;
@@ -144,6 +140,23 @@ static int handle_dir(request_rec *r)
ap_construct_url(r->pool, ifile, r));
return HTTP_MOVED_PERMANENTLY;
}
+ return OK;
+}
+
+static int handle_dir(request_rec *r)
+{
+ dir_config_rec *d;
+ char *dummy_ptr[1];
+ char **names_ptr;
+ int num_names;
+ int error_notfound = 0;
+
+ if (strcmp(r->handler,DIR_MAGIC_TYPE)) {
+ return DECLINED;
+ }
+
+ d = (dir_config_rec *) ap_get_module_config(r->per_dir_config,
+ &dir_module);
/* KLUDGE --- make the sub_req lookups happen in the right directory.
* Fixing this in the sub_req_lookup functions themselves is difficult,
@@ -224,7 +237,10 @@ static int handle_dir(request_rec *r)
static void register_hooks(apr_pool_t *p)
{
- ap_hook_fixups(handle_dir,NULL,NULL,APR_HOOK_MIDDLE);
+ static const char * const aszSucc[]={"mod_autoindex.c", NULL};
+
+ ap_hook_fixups(fixup_dir,NULL,NULL,APR_HOOK_MIDDLE);
+ ap_hook_handler(handle_dir,NULL,aszSucc,APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA dir_module = {