You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2007/11/09 10:18:57 UTC
svn commit: r593462 - /tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
Author: mturk
Date: Fri Nov 9 01:18:47 2007
New Revision: 593462
URL: http://svn.apache.org/viewvc?rev=593462&view=rev
Log:
Initialize and allocate uw_map on first directive. Do not allocate on JkMountCopy if no additional maps are present
Modified:
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=593462&r1=593461&r2=593462&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Fri Nov 9 01:18:47 2007
@@ -1014,6 +1014,12 @@
if (jk_file_exists(conf->mount_file) != JK_TRUE)
return "Can't find the mount file specified";
+ if (!conf->uri_to_context) {
+ if (!jk_map_alloc(&(conf->uri_to_context))) {
+ return "JkMountFile Memory error";
+ }
+ }
+
return NULL;
}
@@ -2377,10 +2383,7 @@
c->strip_session = JK_FALSE;
}
- if (!jk_map_alloc(&(c->uri_to_context))) {
- jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
- }
-
+ c->uri_to_context = NULL;
c->uw_map = NULL;
c->envvars_in_use = JK_FALSE;
@@ -2464,13 +2467,12 @@
}
}
- if (overrides->mount_file_reload == JK_UNSET)
- overrides->mount_file_reload = base->mount_file_reload;
- if (overrides->mountcopy == JK_TRUE ||
- (overrides->mountcopy == JK_UNSET && jk_mount_copy_all == JK_TRUE)) {
+ if (overrides->uri_to_context) {
if (jk_map_copy(base->uri_to_context, overrides->uri_to_context) == JK_FALSE) {
jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, "Memory error");
}
+ if (overrides->mount_file_reload == JK_UNSET)
+ overrides->mount_file_reload = base->mount_file_reload;
if (!overrides->mount_file)
overrides->mount_file = base->mount_file;
if (!overrides->alias_dir)
@@ -2804,10 +2806,11 @@
* Therefore we check, if this config structure really belongs to this
* vhost, otherwise we create a new one and merge.
*/
- if (sconf && sconf->s != srv && jk_mount_copy_all == JK_FALSE) {
+ if (sconf && sconf->s != srv) {
jk_server_conf_t *srvconf = (jk_server_conf_t *)create_jk_config(pconf, srv);
sconf = (jk_server_conf_t *)merge_jk_config(pconf, sconf, srvconf);
ap_set_module_config(srv->module_config, &jk_module, sconf);
+
}
if (sconf && sconf->was_initialized == JK_FALSE) {
@@ -2815,18 +2818,25 @@
if (open_jklog(srv, pconf))
return HTTP_INTERNAL_SERVER_ERROR;
sconf->options &= ~sconf->exclude_options;
- if (!uri_worker_map_alloc(&(sconf->uw_map),
- sconf->uri_to_context, sconf->log))
- jk_error_exit(APLOG_MARK, APLOG_EMERG, srv,
- srv->process->pool, "Memory error");
- if (sconf->options & JK_OPT_REJECTUNSAFE)
- sconf->uw_map->reject_unsafe = 1;
- else
- sconf->uw_map->reject_unsafe = 0;
- if (sconf->mount_file) {
- sconf->uw_map->fname = sconf->mount_file;
- sconf->uw_map->reload = sconf->mount_file_reload;
- uri_worker_map_load(sconf->uw_map, sconf->log);
+ if (sconf->uri_to_context) {
+ if (!uri_worker_map_alloc(&(sconf->uw_map),
+ sconf->uri_to_context, sconf->log))
+ jk_error_exit(APLOG_MARK, APLOG_EMERG, srv,
+ srv->process->pool, "Memory error");
+ if (sconf->options & JK_OPT_REJECTUNSAFE)
+ sconf->uw_map->reject_unsafe = 1;
+ else
+ sconf->uw_map->reject_unsafe = 0;
+ if (sconf->mount_file) {
+ sconf->uw_map->fname = sconf->mount_file;
+ sconf->uw_map->reload = sconf->mount_file_reload;
+ uri_worker_map_load(sconf->uw_map, sconf->log);
+ }
+ }
+ else {
+ if (sconf->mountcopy == JK_TRUE || jk_mount_copy_all == JK_TRUE) {
+ sconf->uw_map = conf->uw_map;
+ }
}
if (sconf->format_string) {
sconf->format =
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org