httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r571622 - in /httpd/httpd/branches/2.2.x: STATUS modules/proxy/mod_proxy.c
Date Fri, 31 Aug 2007 22:25:00 GMT
Author: jim
Date: Fri Aug 31 15:24:58 2007
New Revision: 571622

URL: http://svn.apache.org/viewvc?rev=571622&view=rev
Log:
Merge r427920 from trunk:

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

Modified:
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=571622&r1=571621&r2=571622&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Fri Aug 31 15:24:58 2007
@@ -79,15 +79,6 @@
 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

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c?rev=571622&r1=571621&r2=571622&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c Fri Aug 31 15:24:58 2007
@@ -1605,6 +1605,7 @@
     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 @@
         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 @@
     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);
         }
     }
 



Mime
View raw message