You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2007/10/01 01:22:34 UTC

svn commit: r580809 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml

Author: rjung
Date: Sun Sep 30 16:22:33 2007
New Revision: 580809

URL: http://svn.apache.org/viewvc?rev=580809&view=rev
Log:
Add new value "All" for JkMountCopy directive.
This will switch the default of JkMountCopy from
Off to On for all virtual servers.
For mass histing this saves a lot of memory,
in case lots of vhosts don't have individual
JK directives. With "All" they will share the same
uw_map, more prcisely they will share the same jk_server_conf.

Modified:
    tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
    tomcat/connectors/trunk/jk/xdocs/reference/apache.xml

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=580809&r1=580808&r2=580809&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Sun Sep 30 16:22:33 2007
@@ -225,6 +225,7 @@
 */
 static jk_map_t *jk_worker_properties = NULL;
 static char *jk_worker_file = NULL;
+static int jk_mount_copy_all = JK_FALSE;
 
 static int JK_METHOD ws_start_response(jk_ws_service_t *s,
                                        int status,
@@ -811,18 +812,25 @@
 /*
  * JkMountCopy directive handling
  *
- * JkMountCopy On/Off
+ * JkMountCopy On/Off/All
  */
 
-static const char *jk_set_mountcopy(cmd_parms * cmd, void *dummy, int flag)
+static const char *jk_set_mountcopy(cmd_parms * cmd,
+                                    void *dummy, char *mount_copy)
 {
     server_rec *s = cmd->server;
     jk_server_conf_t *conf =
         (jk_server_conf_t *) ap_get_module_config(s->module_config,
                                                   &jk_module);
-
-    /* Set up our value */
-    conf->mountcopy = flag ? JK_TRUE : JK_FALSE;
+    if (! strcasecmp(mount_copy, "all")) {
+        jk_mount_copy_all = JK_TRUE;
+    }
+    else if (strcasecmp(mount_copy, "on") && strcasecmp(mount_copy, "off")) {
+        return "JkMountCopy must be All, On or Off";
+    }
+    else {
+        conf->mountcopy = strcasecmp(mount_copy, "off") ? JK_TRUE : JK_FALSE;
+    }
 
     return NULL;
 }
@@ -1853,7 +1861,7 @@
      * JkMountCopy specifies if mod_jk should copy the mount points
      * from the main server to the virtual servers.
      */
-    {"JkMountCopy", jk_set_mountcopy, NULL, RSRC_CONF, FLAG,
+    {"JkMountCopy", jk_set_mountcopy, NULL, RSRC_CONF, TAKE1,
      "Should the base server mounts be copied to the virtual server"},
 
     /*
@@ -2192,6 +2200,7 @@
     c->was_initialized = JK_FALSE;
 
     if (s->is_virtual) {
+        c->mountcopy = JK_UNSET;
         c->mount_file_reload = JK_UNSET;
         c->log_level = JK_UNSET;
         c->options = 0;
@@ -2205,6 +2214,7 @@
         c->key_size_indicator = NULL;
         c->strip_session = JK_UNSET;
     } else {
+        c->mountcopy = JK_FALSE;
         c->mount_file_reload = JK_URIMAP_DEF_RELOAD;
         c->log_level = JK_LOG_DEF_LEVEL;
         c->options = JK_OPT_FWDURIDEFAULT;
@@ -2349,7 +2359,8 @@
 
     if (overrides->mount_file_reload == JK_UNSET)
         overrides->mount_file_reload = base->mount_file_reload;
-    if (overrides->mountcopy) {
+    if (overrides->mountcopy == JK_TRUE ||
+        (overrides->mountcopy == JK_UNSET && jk_mount_copy_all == JK_TRUE)) {
         copy_jk_map(p, overrides->s, base->uri_to_context,
                     overrides->uri_to_context);
         if (!overrides->mount_file)
@@ -2511,7 +2522,7 @@
     for (; srv; srv = srv->next) {
         jk_server_conf_t *sconf = (jk_server_conf_t *)ap_get_module_config(srv->module_config,
                                                                            &jk_module);
-        if (sconf && sconf->was_initialized == JK_TRUE) {
+        if (sconf && sconf->was_initialized == JK_TRUE && jk_mount_copy_all == JK_FALSE) {
             ap_set_module_config(srv->module_config, &jk_module,
                                  clone_jk_config(p, srv));
         }
@@ -2905,6 +2916,7 @@
         jk_map_free(&jk_worker_properties);
         jk_worker_properties = NULL;
         jk_worker_file = NULL;
+        jk_mount_copy_all = JK_FALSE;
     }
 
     /* loop through all available servers to clean up all configuration

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=580809&r1=580808&r2=580809&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 Sun Sep 30 16:22:33 2007
@@ -236,6 +236,7 @@
 */
 static jk_map_t *jk_worker_properties = NULL;
 static char *jk_worker_file = NULL;
+static int jk_mount_copy_all = JK_FALSE;
 
 static int JK_METHOD ws_start_response(jk_ws_service_t *s,
                                        int status,
@@ -834,18 +835,30 @@
 /*
  * JkMountCopy directive handling
  *
- * JkMountCopy On/Off
+ * JkMountCopy On/Off/All
  */
 
-static const char *jk_set_mountcopy(cmd_parms * cmd, void *dummy, int flag)
+static const char *jk_set_mountcopy(cmd_parms * cmd,
+                                    void *dummy, const char *mount_copy)
 {
     server_rec *s = cmd->server;
     jk_server_conf_t *conf =
         (jk_server_conf_t *) ap_get_module_config(s->module_config,
                                                   &jk_module);
 
-    /* Set up our value */
-    conf->mountcopy = flag ? JK_TRUE : JK_FALSE;
+    if (! strcasecmp(mount_copy, "all")) {
+        const char *err_string = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+        if (err_string != NULL) {
+            return err_string;
+        }
+        jk_mount_copy_all = JK_TRUE;
+    }
+    else if (strcasecmp(mount_copy, "on") && strcasecmp(mount_copy, "off")) {
+        return "JkMountCopy must be All, On or Off";
+    }
+    else {
+        conf->mountcopy = strcasecmp(mount_copy, "off") ? JK_TRUE : JK_FALSE;
+    }
 
     return NULL;
 }
@@ -1882,8 +1895,8 @@
      * JkMountCopy specifies if mod_jk should copy the mount points
      * from the main server to the virtual servers.
      */
-    AP_INIT_FLAG("JkMountCopy", jk_set_mountcopy, NULL, RSRC_CONF,
-                 "Should the base server mounts be copied to the virtual server"),
+    AP_INIT_TAKE1("JkMountCopy", jk_set_mountcopy, NULL, RSRC_CONF,
+                  "Should the base server mounts be copied to the virtual server"),
 
     /*
      * JkStripSession specifies if mod_jk should strip the ;jsessionid
@@ -2262,6 +2275,7 @@
         jk_map_free(&jk_worker_properties);
         jk_worker_properties = NULL;
         jk_worker_file = NULL;
+        jk_mount_copy_all = JK_FALSE;
     }
 
     while (NULL != s) {
@@ -2301,11 +2315,11 @@
     c->stamp_format_string = NULL;
     c->format_string = NULL;
     c->format = NULL;
-    c->mountcopy = JK_FALSE;
     c->exclude_options = 0;
     c->was_initialized = JK_FALSE;
 
     if (s->is_virtual) {
+        c->mountcopy = JK_UNSET;
         c->mount_file_reload = JK_UNSET;
         c->log_level = JK_UNSET;
         c->options = 0;
@@ -2319,6 +2333,7 @@
         c->key_size_indicator = NULL;
         c->strip_session = JK_UNSET;
     } else {
+        c->mountcopy = JK_FALSE;
         c->mount_file_reload = JK_URIMAP_DEF_RELOAD;
         c->log_level = JK_LOG_DEF_LEVEL;
         c->options = JK_OPT_FWDURIDEFAULT;
@@ -2469,7 +2484,8 @@
 
     if (overrides->mount_file_reload == JK_UNSET)
         overrides->mount_file_reload = base->mount_file_reload;
-    if (overrides->mountcopy) {
+    if (overrides->mountcopy == JK_TRUE ||
+        (overrides->mountcopy == JK_UNSET && jk_mount_copy_all == JK_TRUE)) {
         copy_jk_map(p, overrides->s, base->uri_to_context,
                     overrides->uri_to_context);
         if (!overrides->mount_file)
@@ -2798,7 +2814,7 @@
             for (; srv; srv = srv->next) {
                 jk_server_conf_t *sconf = (jk_server_conf_t *)ap_get_module_config(srv->module_config,
                                                                                    &jk_module);
-                if (sconf && sconf->was_initialized == JK_TRUE) {
+                if (sconf && sconf->was_initialized == JK_TRUE && jk_mount_copy_all == JK_FALSE) {
                     ap_set_module_config(srv->module_config, &jk_module,
                                          clone_jk_config(pconf, srv));
                 }

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=580809&r1=580808&r2=580809&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Sun Sep 30 16:22:33 2007
@@ -44,6 +44,28 @@
   <subsection name="Native">
     <changelog>
       <update>
+        Apache: Add new value "All" for JkMountCopy. (rjung)
+      </update>
+      <fix>
+        <bug>43516</bug>: Memory leak for Apache httpd module
+        of size 8KB for every virtual host without JK directive
+        after each restart. (rjung)
+      </fix>
+      <update>
+        Apache: Cleanup init and destroy of server configuration. (rjung)
+      </update>
+      <update>
+        Apache: Remove global configuration items from per server
+        configuration. (rjung)
+      </update>
+      <update>
+        Apache: Remove unused attributes secret_key and
+        automount/JkAutoMount. (rjung)
+      </update>
+      <update>
+        Cleanup of jk_uri_worker_map. (rjung)
+      </update>
+      <update>
         Documentation: Small additions to JkShmFile documentation.
         Contributed by Gerhardus Geldenhuis. (rjung)
       </update>

Modified: tomcat/connectors/trunk/jk/xdocs/reference/apache.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/reference/apache.xml?rev=580809&r1=580808&r2=580809&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/reference/apache.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/reference/apache.xml Sun Sep 30 16:22:33 2007
@@ -164,7 +164,7 @@
 There is no default value.
 </p></attribute>
 <attribute name="JkMountCopy" required="false"><p>
-If this directive is set to On in some virtual server,
+If this directive is set to "On" in some virtual server,
 the mounts from the global server will be copied to the
 virtual server, more precisely all mounts defined by JkMount
 or JkUnMount. The Mounts defined by JkMountFile and JkAutoAlias
@@ -174,6 +174,9 @@
 This directive is only allowed inside VirtualHost.
 <br/>
 The default is Off.
+<br/>
+Starting with version 1.2.26 you can also set it to "All" in the
+global virtual server. This will switch the default to On.
 </p></attribute>
 <attribute name="JkWorkerIndicator" required="false"><p>
 Name of the Apache environment variable that can be used to set worker names



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org