]> granicus.if.org Git - apache/commitdiff
There is absolutely no reason to have two 4k-sized constant strmatch patterns
authorStefan Fritsch <sf@apache.org>
Fri, 14 Oct 2011 19:51:17 +0000 (19:51 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 14 Oct 2011 19:51:17 +0000 (19:51 +0000)
in each per-dir config.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1183475 13f79535-47bb-0310-9956-ffa450edef68

include/ap_mmn.h
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c

index d48a1ca44d3170686c736208f26e5435824d8a8b..171655b79df6b162d920f3b970150649e6751a41 100644 (file)
  * 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 */
 
index 0a9fbc97c3df73e7eee4d61c51ef2c0e1316b475..d5cf9ea687f4a8f85613a1c7d76c391bff334fe2 100644 (file)
@@ -1220,8 +1220,6 @@ static void *create_proxy_dir_config(apr_pool_t *p, char *dummy)
     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_pool_t *p, void *basev, void *addv)
         = 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 *pconf, apr_pool_t *plog,
     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;
 }
index 85886e2bf43e2f272dd136bd72f7c0ea27de1b6f..1f269f921e9ab7e2d3a959008ba2994fc9b98408 100644 (file)
@@ -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*/
 /** @} */
index 3b91d9e97dfef249ec88b6f29b880a6409d925fc..5c1f8423662ef951cd02c9bf9feb34078befdc56 100644 (file)
@@ -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_cookie_reverse_map(request_rec *r,
     * 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_cookie_reverse_map(request_rec *r,
         }
     }
 
-    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, ';');