httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Morgan <rmor...@covalent.net>
Subject Re: cvs commit: httpd-2.0/modules/mappers mod_dir.c
Date Wed, 21 Feb 2001 08:37:54 GMT

I don't think this change is going to work because mod_dir does more
than just check if a redirect is going to be needed.  It also handles
the sending of index files.  This means that with this change running
ap_sub_req_* could result in a index file being sent, which is not the
correct behavior.

The sending of the index file still needs to be implemented as a handler.
I would suggest that we either back this change out, or move the uri
checking into to fixups phase to allow subrequests to determine if the
request will generate a HTTP_MOVED_PERMANANTLY response.  A patch is
attached, only minimally tested since an update of my tree has resulted
in undefined references to pthread_sigmask.

-Ryan

>   Index: CHANGES
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/CHANGES,v
>   retrieving revision 1.99
>   retrieving revision 1.100
>   diff -u -d -b -w -u -r1.99 -r1.100
>   --- CHANGES	2001/02/20 20:50:05	1.99
>   +++ CHANGES	2001/02/21 01:04:39	1.100
>   @@ -1,5 +1,11 @@
>    Changes with Apache 2.0.12-dev
>    
>   +  *) Make mod_dir use a fixup for sending a redirect to the browser.
>   +     Before this, we were using a handler, which doesn't make much
>   +     sense, because the handler wasn't generating any data, it would
>   +     either return a redirect error code, or DECLINED.  This fits the
>   +     current hooks better.  [Ryan Morgan <rmorgan@covalent.net>]
>   +
>      *) Make the threaded MPM use APR threads instead of pthreads.
>         [Ryan Bloom]
>    
>   
>   
>   
>   1.29      +3 -4      httpd-2.0/modules/mappers/mod_dir.c
>   
>   Index: mod_dir.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_dir.c,v
>   retrieving revision 1.28
>   retrieving revision 1.29
>   diff -u -d -b -w -u -r1.28 -r1.29
>   --- mod_dir.c	2001/02/16 04:26:40	1.28
>   +++ mod_dir.c	2001/02/21 01:04:39	1.29
>   @@ -124,8 +124,9 @@
>        int num_names;
>        int error_notfound = 0;
>    
>   -    if(strcmp(r->handler,DIR_MAGIC_TYPE))
>   +    if (r->finfo.filetype != APR_DIR) {
>    	return DECLINED;
>   +    }
>    
>        d = (dir_config_rec *) ap_get_module_config(r->per_dir_config,
>    						&dir_module);
>   @@ -223,9 +224,7 @@
>    
>    static void register_hooks(apr_pool_t *p)
>    {
>   -    static const char * const aszSucc[]={ "mod_autoindex.c", NULL };
>   -
>   -    ap_hook_handler(handle_dir,NULL,aszSucc,APR_HOOK_MIDDLE);
>   +    ap_hook_fixups(handle_dir,NULL,NULL,APR_HOOK_MIDDLE);
>    }
>    
>    module AP_MODULE_DECLARE_DATA dir_module = {

Mime
View raw message