You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/10/14 21:51:18 UTC

svn commit: r1183475 - in /httpd/httpd/trunk: include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c

Author: sf
Date: Fri Oct 14 19:51:17 2011
New Revision: 1183475

URL: http://svn.apache.org/viewvc?rev=1183475&view=rev
Log:
There is absolutely no reason to have two 4k-sized constant strmatch patterns
in each per-dir config.

Modified:
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1183475&r1=1183474&r2=1183475&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Fri Oct 14 19:51:17 2011
@@ -358,12 +358,14 @@
  * 20110724.10(2.3.15-dev) Export ap_max_mem_free
  * 20111009.0 (2.3.15-dev) Remove ap_proxy_removestr(),
  *                         add ap_unixd_config.group_name
+ * 20111014.0 (2.3.15-dev) Remove cookie_path_str and cookie_domain_str from
+ *                         proxy_dir_conf
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20111009
+#define MODULE_MAGIC_NUMBER_MAJOR 20111014
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                   /* 0...n */
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1183475&r1=1183474&r2=1183475&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Fri Oct 14 19:51:17 2011
@@ -1220,8 +1220,6 @@ static void *create_proxy_dir_config(apr
     new->raliases = apr_array_make(p, 10, sizeof(struct proxy_alias));
     new->cookie_paths = apr_array_make(p, 10, sizeof(struct proxy_alias));
     new->cookie_domains = apr_array_make(p, 10, sizeof(struct proxy_alias));
-    new->cookie_path_str = apr_strmatch_precompile(p, "path=", 0);
-    new->cookie_domain_str = apr_strmatch_precompile(p, "domain=", 0);
     new->preserve_host_set = 0;
     new->preserve_host = 0;
     new->interpolate_env = -1; /* unset */
@@ -1248,8 +1246,6 @@ static void *merge_proxy_dir_config(apr_
         = apr_array_append(p, base->cookie_paths, add->cookie_paths);
     new->cookie_domains
         = apr_array_append(p, base->cookie_domains, add->cookie_domains);
-    new->cookie_path_str = base->cookie_path_str;
-    new->cookie_domain_str = base->cookie_domain_str;
     new->interpolate_env = (add->interpolate_env == -1) ? base->interpolate_env
                                                         : add->interpolate_env;
     new->preserve_host = (add->preserve_host_set == 0) ? base->preserve_host
@@ -2299,6 +2295,8 @@ static int proxy_post_config(apr_pool_t 
     proxy_ssl_disable = APR_RETRIEVE_OPTIONAL_FN(ssl_engine_disable);
     proxy_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https);
     proxy_ssl_val = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup);
+    ap_proxy_strmatch_path = apr_strmatch_precompile(pconf, "path=", 0);
+    ap_proxy_strmatch_domain = apr_strmatch_precompile(pconf, "domain=", 0);
 
     return OK;
 }

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1183475&r1=1183474&r2=1183475&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Fri Oct 14 19:51:17 2011
@@ -193,8 +193,6 @@ typedef struct {
     apr_array_header_t *raliases;
     apr_array_header_t* cookie_paths;
     apr_array_header_t* cookie_domains;
-    const apr_strmatch_pattern* cookie_path_str;
-    const apr_strmatch_pattern* cookie_domain_str;
     signed char p_is_fnmatch; /* Is the path an fnmatch candidate? */
     signed char interpolate_env;
     struct proxy_alias *alias;
@@ -907,6 +905,8 @@ int ap_proxy_lb_workers(void);
 extern module PROXY_DECLARE_DATA proxy_module;
 
 extern int PROXY_DECLARE_DATA proxy_lb_workers;
+extern const apr_strmatch_pattern * PROXY_DECLARE_DATA ap_proxy_strmatch_path;
+extern const apr_strmatch_pattern * PROXY_DECLARE_DATA ap_proxy_strmatch_domain;
 
 #endif /*MOD_PROXY_H*/
 /** @} */

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1183475&r1=1183474&r2=1183475&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Fri Oct 14 19:51:17 2011
@@ -65,6 +65,8 @@ static struct wstat {
 /* Global balancer counter */
 int PROXY_DECLARE_DATA proxy_lb_workers = 0;
 static int lb_workers_limit = 0;
+const apr_strmatch_pattern * PROXY_DECLARE_DATA ap_proxy_strmatch_path;
+const apr_strmatch_pattern * PROXY_DECLARE_DATA ap_proxy_strmatch_domain;
 
 static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r);
 static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r);
@@ -1170,7 +1172,7 @@ PROXY_DECLARE(const char *) ap_proxy_coo
     * Find the match and replacement, but save replacing until we've done
     * both path and domain so we know the new strlen
     */
-    if ((pathp = apr_strmatch(conf->cookie_path_str, str, len)) != NULL) {
+    if ((pathp = apr_strmatch(ap_proxy_strmatch_path, str, len)) != NULL) {
         pathp += 5;
         poffs = pathp - str;
         pathe = ap_strchr_c(pathp, ';');
@@ -1192,7 +1194,7 @@ PROXY_DECLARE(const char *) ap_proxy_coo
         }
     }
 
-    if ((domainp = apr_strmatch(conf->cookie_domain_str, str, len)) != NULL) {
+    if ((domainp = apr_strmatch(ap_proxy_strmatch_domain, str, len)) != NULL) {
         domainp += 7;
         doffs = domainp - str;
         domaine = ap_strchr_c(domainp, ';');