From: Ryan Bloom Date: Wed, 21 Feb 2001 17:54:41 +0000 (+0000) Subject: Split the mod_dir fixup into two parts. The first determines if this X-Git-Tag: 2.0.12~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36c56ce7222874fbf37a1cefac862f4dcd8e49ff;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index 1293bd654a8..4c4be622397 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 = {