Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 137458 Details for
Bug 139451
www-servers/apache - deprecated use of AddDirectoryIndex
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
rewritten patch
02_all_gentoo_mod_dir_incremental.patch (text/plain), 3.81 KB, created by
Marek Wróbel
on 2007-12-01 13:37:50 UTC
(
hide
)
Description:
rewritten patch
Filename:
MIME Type:
Creator:
Marek Wróbel
Created:
2007-12-01 13:37:50 UTC
Size:
3.81 KB
patch
obsolete
>--- httpd-2.2.6-r2.orig/modules/mappers/mod_dir.c 2007-11-30 20:02:53.000000000 +0100 >+++ httpd-2.2.6-r2/modules/mappers/mod_dir.c 2007-11-30 19:37:18.000000000 +0100 >@@ -39,19 +39,69 @@ > > typedef struct dir_config_struct { > apr_array_header_t *index_names; >+ apr_array_header_t *index_names_base; >+ apr_array_header_t *index_names_incr; > slash_cfg do_slash; > } dir_config_rec; > > #define DIR_CMD_PERMS OR_INDEXES > >+static void update_index(dir_config_rec *d, apr_pool_t *p) >+{ >+ if ((!d->index_names_base) && (!d->index_names_incr)) >+ { >+ if (d->index_names) >+ { >+ // clear old entries >+ while (apr_array_pop(d->index_names)) >+ ; >+ // I think it should be freed, but I don't know how >+ d->index_names = NULL; >+ } >+ >+ return; >+ } >+ >+ if (d->index_names) >+ // clear old entries >+ while (apr_array_pop(d->index_names)) >+ ; >+ else >+ // allocate >+ d->index_names = apr_array_make(p, 2, sizeof(char *)); >+ >+ if (d->index_names_base) >+ apr_array_cat(d->index_names, d->index_names_base); >+ >+ if (d->index_names_incr) >+ apr_array_cat(d->index_names, d->index_names_incr); >+} >+ > static const char *add_index(cmd_parms *cmd, void *dummy, const char *arg) > { > dir_config_rec *d = dummy; > >- if (!d->index_names) { >- d->index_names = apr_array_make(cmd->pool, 2, sizeof(char *)); >+ if (!d->index_names_base) { >+ d->index_names_base = apr_array_make(cmd->pool, 2, sizeof(char *)); > } >- *(const char **)apr_array_push(d->index_names) = arg; >+ *(const char **)apr_array_push(d->index_names_base) = arg; >+ >+ update_index(d, cmd->pool); >+ >+ return NULL; >+} >+ >+static const char *add_index_incr(cmd_parms *cmd, void *dummy, const char *arg) >+{ >+ dir_config_rec *d = dummy; >+ >+ if (!d->index_names_incr) { >+ d->index_names_incr = apr_array_make(cmd->pool, 2, sizeof(char *)); >+ } >+ *(const char **)apr_array_push(d->index_names_incr) = arg; >+ >+ update_index(d, cmd->pool); >+ > return NULL; > } > >@@ -67,6 +117,8 @@ > { > AP_INIT_ITERATE("DirectoryIndex", add_index, NULL, DIR_CMD_PERMS, > "a list of file names"), >+ AP_INIT_ITERATE("AddDirectoryIndex", add_index_incr, NULL, DIR_CMD_PERMS, >+ "a list of file names"), > AP_INIT_FLAG("DirectorySlash", configure_slash, NULL, DIR_CMD_PERMS, > "On or Off"), > {NULL} >@@ -77,17 +129,38 @@ > dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec)); > > new->index_names = NULL; >+ new->index_names_base = NULL; >+ new->index_names_incr = NULL; > new->do_slash = SLASH_UNSET; > return (void *) new; > } > > static void *merge_dir_configs(apr_pool_t *p, void *basev, void *addv) > { >- dir_config_rec *new = apr_pcalloc(p, sizeof(dir_config_rec)); >+ dir_config_rec *new = (dir_config_rec *)create_dir_config(p, NULL); > dir_config_rec *base = (dir_config_rec *)basev; > dir_config_rec *add = (dir_config_rec *)addv; > >- new->index_names = add->index_names ? add->index_names : base->index_names; >+ if (add->index_names_base) >+ new->index_names_base = add->index_names_base; >+ else >+ new->index_names_base = base->index_names_base; >+ >+ if ((!add->index_names_base) && base->index_names_incr) >+ { >+ new->index_names_incr = apr_array_make(p, 2, sizeof(char *)); >+ apr_array_cat(new->index_names_incr, base->index_names_incr); >+ } >+ >+ if (add->index_names_incr) >+ { >+ if (!new->index_names_incr) >+ new->index_names_incr = apr_array_make(p, 2, sizeof(char *)); >+ apr_array_cat(new->index_names_incr, add->index_names_incr); >+ } >+ >+ update_index(new, p); >+ > new->do_slash = > (add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash; > return new;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139451
:
115204
| 137458