]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r427920 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 31 Aug 2007 22:24:58 +0000 (22:24 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 31 Aug 2007 22:24:58 +0000 (22:24 +0000)
Enable ProxySet inside <Proxy> section to
create balancer or worker if they were not
already created.
This allows to have ProxySet directive before
BalancerMember directives inside Proxy section.
Submitted by: mturk
Reviewed by: root

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@571622 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/mod_proxy.c

diff --git a/STATUS b/STATUS
index 20c3c7e6c21a97954e11db03c21eb3ddfe0b7aaf..17b01fd3e76ad8d921be6f03c58d9775942b36e3 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,15 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * mod_proxy: Enable ProxySet inside <Proxy> section to create balancer or
-      worker if they were not already created. This allows to have ProxySet
-      directive before BalancerMember directives inside Proxy section.
-      Trunk version of patch:
-         http://svn.apache.org/viewcvs.cgi?rev=427920&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-      +1: rpluem, jim, niq
-
     * mod_proxy: Allow optional name=value options within <Proxy section line.
       Additional arguments are allowed only for 'standard' url's, meaning that
       the wildchar urls will return error like before. This allow to specify
index 71c78a703316350579b704916ba616be174992c0..035dac0bafde2ae334113f443db156369fcae5cb 100644 (file)
@@ -1605,6 +1605,7 @@ static const char *
     proxy_balancer *balancer = NULL;
     proxy_worker *worker = NULL;
     const char *err;
+    int in_proxy_section = 0;
 
     if (cmd->directive->parent &&
         strncasecmp(cmd->directive->parent->directive,
@@ -1616,6 +1617,7 @@ static const char *
         name = ap_getword_conf(cmd->temp_pool, &pargs);
         if ((word = ap_strchr(name, '>')))
             *word = '\0';
+        in_proxy_section = 1;
     }
     else {
         /* Standard set directive with worker/balancer
@@ -1627,15 +1629,32 @@ static const char *
     if (strncasecmp(name, "balancer:", 9) == 0) {
         balancer = ap_proxy_get_balancer(cmd->pool, conf, name);
         if (!balancer) {
-            return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '",
-                               name, "' Balancer.", NULL);
+            if (in_proxy_section) {
+                err = ap_proxy_add_balancer(&balancer,
+                                            cmd->pool,
+                                            conf, name);
+                if (err)
+                    return apr_pstrcat(cmd->temp_pool, "ProxySet ",
+                                       err, NULL);
+            }
+            else
+                return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '",
+                                   name, "' Balancer.", NULL);
         }
     }
     else {
         worker = ap_proxy_get_worker(cmd->temp_pool, conf, name);
         if (!worker) {
-            return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '",
-                               name, "' Worker.", NULL);
+            if (in_proxy_section) {
+                err = ap_proxy_add_worker(&worker, cmd->pool,
+                                          conf, name);
+                if (err)
+                    return apr_pstrcat(cmd->temp_pool, "ProxySet ",
+                                       err, NULL);
+            }
+            else
+                return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '",
+                                   name, "' Worker.", NULL);
         }
     }