tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r591504 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c
Date Fri, 02 Nov 2007 23:00:54 GMT
Author: rjung
Date: Fri Nov  2 16:00:52 2007
New Revision: 591504

URL: http://svn.apache.org/viewvc?rev=591504&view=rev
Log:
Use new general purpose function jk_map_copy()
instead of httpd private copy_jk_map().

Modified:
    tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c

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=591504&r1=591503&r2=591504&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 Fri Nov  2 16:00:52 2007
@@ -2278,23 +2278,6 @@
 }
 
 
-static void copy_jk_map(ap_pool * p, server_rec * s, jk_map_t *src,
-                        jk_map_t *dst)
-{
-    int sz = jk_map_size(src);
-    int i;
-    for (i = 0; i < sz; i++) {
-        const char *name = jk_map_name_at(src, i);
-        if (jk_map_get(dst, name, NULL) == NULL) {
-            if (!jk_map_put (dst, name,
-                 ap_pstrdup(p, jk_map_get_string(src, name, NULL)),
-                            NULL)) {
-                jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
-            }
-        }
-    }
-}
-
 static void *merge_jk_config(ap_pool * p, void *basev, void *overridesv)
 {
     jk_server_conf_t *base = (jk_server_conf_t *) basev;
@@ -2361,8 +2344,9 @@
         overrides->mount_file_reload = base->mount_file_reload;
     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 (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)
             overrides->mount_file = base->mount_file;
         if (!overrides->alias_dir)

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=591504&r1=591503&r2=591504&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  2 16:00:52 2007
@@ -2398,25 +2398,6 @@
 }
 
 
-/** Utility - copy a map . XXX Should move to jk_map, it's generic code.
- */
-static void copy_jk_map(apr_pool_t * p, server_rec * s, jk_map_t *src,
-                        jk_map_t *dst)
-{
-    int sz = jk_map_size(src);
-    int i;
-    for (i = 0; i < sz; i++) {
-        const char *name = jk_map_name_at(src, i);
-        if (jk_map_get(dst, name, NULL) == NULL) {
-            if (!jk_map_put(dst, name,
-                            apr_pstrdup(p, jk_map_get_string(src, name, NULL)),
-                            NULL)) {
-                jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
-            }
-        }
-    }
-}
-
 /** Standard apache callback, merge jk options specified in <Directory>
     context or <Host>.
  */
@@ -2486,8 +2467,9 @@
         overrides->mount_file_reload = base->mount_file_reload;
     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 (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)
             overrides->mount_file = base->mount_file;
         if (!overrides->alias_dir)



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


Mime
View raw message