* dynamic growth of balancer members; Remove
* BalancerNonce in favor of 'nonce' parameter.
* 20110117.0 (2.3.11-dev) Merge <If> sections in separate step (ap_if_walk).
- * Add core_dir_config->sec_if.
+ * Add core_dir_config->sec_if. Add ap_add_if_conf().
+ * Add pool argument to ap_add_file_conf().
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
/* for mod_perl */
AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config);
AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config);
-AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config);
-AP_CORE_DECLARE(void) ap_add_if_conf(core_dir_config *conf, void *url_config);
+AP_CORE_DECLARE(void) ap_add_file_conf(apr_pool_t *p, core_dir_config *conf, void *url_config);
+AP_CORE_DECLARE(void) ap_add_if_conf(apr_pool_t *p, core_dir_config *conf, void *url_config);
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
/* Core filters; not exported. */
* conf->limit_cpu = NULL;
* conf->limit_mem = NULL;
* conf->limit_nproc = NULL;
+ * conf->sec_file = NULL;
+ * conf->sec_if = NULL;
*/
conf->limit_req_body = AP_LIMIT_REQ_BODY_UNSET;
conf->limit_xml_body = AP_LIMIT_UNSET;
- conf->sec_file = apr_array_make(a, 2, sizeof(ap_conf_vector_t *));
- conf->sec_if = apr_array_make(a, 2, sizeof(ap_conf_vector_t *));
conf->server_signature = srv_sig_unset;
*new_space = url_config;
}
-AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config)
+AP_CORE_DECLARE(void) ap_add_file_conf(apr_pool_t *p, core_dir_config *conf,
+ void *url_config)
{
- void **new_space = (void **)apr_array_push(conf->sec_file);
+ void **new_space;
+ if (!conf->sec_file)
+ conf->sec_file = apr_array_make(p, 2, sizeof(ap_conf_vector_t *));
+
+ new_space = (void **)apr_array_push(conf->sec_file);
*new_space = url_config;
}
-AP_CORE_DECLARE(void) ap_add_if_conf(core_dir_config *conf, void *url_config)
+AP_CORE_DECLARE(void) ap_add_if_conf(apr_pool_t *p, core_dir_config *conf,
+ void *url_config)
{
- void **new_space = (void **)apr_array_push(conf->sec_if);
+ void **new_space;
+
+ if (!conf->sec_if)
+ conf->sec_if = apr_array_make(p, 2, sizeof(ap_conf_vector_t *));
+ new_space = (void **)apr_array_push(conf->sec_if);
*new_space = url_config;
}
conf->d_is_fnmatch = apr_fnmatch_test(conf->d) != 0;
conf->r = r;
- ap_add_file_conf((core_dir_config *)mconfig, new_file_conf);
+ ap_add_file_conf(cmd->pool, (core_dir_config *)mconfig, new_file_conf);
if (*arg != '\0') {
return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name,
conf->d_is_fnmatch = 0;
conf->r = NULL;
- ap_add_if_conf((core_dir_config *)mconfig, new_file_conf);
+ ap_add_if_conf(cmd->pool, (core_dir_config *)mconfig, new_file_conf);
if (*arg != '\0') {
return apr_pstrcat(cmd->pool, "Multiple ", thiscmd->name,
ap_conf_vector_t *now_merged = NULL;
core_dir_config *dconf = ap_get_module_config(r->per_dir_config,
&core_module);
- ap_conf_vector_t **sec_ent = (ap_conf_vector_t **)dconf->sec_file->elts;
- int num_sec = dconf->sec_file->nelts;
+ ap_conf_vector_t **sec_ent = NULL;
+ int num_sec = 0;
walk_cache_t *cache;
const char *test_file;
int cached;
+ if (dconf->sec_file) {
+ sec_ent = (ap_conf_vector_t **)dconf->sec_file->elts;
+ num_sec = dconf->sec_file->nelts;
+ }
+
/* To allow broken modules to proceed, we allow missing filenames to pass.
* We will catch it later if it's heading for the core handler.
* directory_walk already posted an INFO note for module debugging.
ap_conf_vector_t *now_merged = NULL;
core_dir_config *dconf = ap_get_module_config(r->per_dir_config,
&core_module);
- ap_conf_vector_t **sec_ent = (ap_conf_vector_t **)dconf->sec_if->elts;
- int num_sec = dconf->sec_if->nelts;
+ ap_conf_vector_t **sec_ent = NULL;
+ int num_sec = 0;
walk_cache_t *cache;
int cached;
int sec_idx;
int cached_matches;
walk_walked_t *last_walk;
+ if (dconf->sec_if) {
+ sec_ent = (ap_conf_vector_t **)dconf->sec_if->elts;
+ num_sec = dconf->sec_if->nelts;
+ }
+
/* No tricks here, there are just no <If > to parse in this context.
* We won't destroy the cache, just in case _this_ redirect is later
* redirected again to a context containing the same or similar <If >.