httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r785425 - in /httpd/httpd/trunk: CHANGES modules/mappers/mod_dir.c
Date Wed, 17 Jun 2009 18:29:49 GMT


On 06/16/2009 11:57 PM, niq@apache.org wrote:
> Author: niq
> Date: Tue Jun 16 21:57:25 2009
> New Revision: 785425
> 
> URL: http://svn.apache.org/viewvc?rev=785425&view=rev
> Log:
> Add DefaultHandler directive to mod_dir.
> PR 47184
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/modules/mappers/mod_dir.c
> 
> 
> Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=785425&r1=785424&r2=785425&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/mappers/mod_dir.c (original)
> +++ httpd/httpd/trunk/modules/mappers/mod_dir.c Tue Jun 16 21:57:25 2009
> @@ -40,6 +40,7 @@
>  typedef struct dir_config_struct {
>      apr_array_header_t *index_names;
>      slash_cfg do_slash;
> +    const char *dflt;
>  } dir_config_rec;
>  
>  #define DIR_CMD_PERMS OR_INDEXES
> @@ -82,6 +83,9 @@
>  
>  static const command_rec dir_cmds[] =
>  {
> +    AP_INIT_TAKE1("DefaultHandler", ap_set_string_slot,
> +                  (void*)APR_OFFSETOF(dir_config_rec, dflt),
> +                  DIR_CMD_PERMS, "Set a default handler"),
>      AP_INIT_RAW_ARGS("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS,
>                      "a list of file names"),
>      AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS,
> @@ -107,9 +111,53 @@
>      new->index_names = add->index_names ? add->index_names : base->index_names;
>      new->do_slash =
>          (add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash;
> +    new->dflt = add->dflt ? add->dflt : base->dflt;
>      return new;
>  }
>  
> +static int fixup_dflt(request_rec *r)
> +{
> +    dir_config_rec *d = ap_get_module_config(r->per_dir_config, &dir_module);
> +    const char *name_ptr;
> +    request_rec *rr;
> +    int error_notfound = 0;
> +    if ((r->finfo.filetype != APR_NOFILE) || (r->handler != NULL)) {
> +        return DECLINED;
> +    }

Doesn't this cause issues when we have configured several different index files via
DirectoryIndex and the first one of these is not present. I guess in this case the
appropriate subrequest should return NOT_FOUND which it does not do here, correct?

Regards

RĂ¼diger


Mime
View raw message