httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1439404 - in /httpd/httpd/trunk: docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h
Date Mon, 28 Jan 2013 13:58:24 GMT
Author: jim
Date: Mon Jan 28 13:58:24 2013
New Revision: 1439404

URL: http://svn.apache.org/viewvc?rev=1439404&view=rev
Log:
ProxyPassInherit directive

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?rev=1439404&r1=1439403&r2=1439404&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Mon Jan 28 13:58:24 2013
@@ -665,19 +665,39 @@ expressions</description>
 </directivesynopsis>
 
 <directivesynopsis>
+    <name>ProxyPassInherit</name>
+    <description>Inherit ProxyPass directives defined from the main server</description>
+    <syntax>ProxyPassInherit On|Off</syntax>
+    <default>ProxyPassInherit On</default>
+    <contextlist><context>server config</context><context>virtual
host</context></contextlist>
+    <compatibility>ProxyPassInherit is only available in Apache HTTP Server 2.5.0 and
later.
+        and later.</compatibility>
+    <usage>
+        <p>This directive will cause the current server/vhost to "inherit"
+            <directive module="mod_proxy">ProxyPass</directive>
+            directives defined in the main server. This can cause issues and
+            inconsistent behavior if using the Balancer Manager for dynamic changes
+            and so should be disabled if using that feature.</p>
+        <p>The setting in the global server defines the default for all vhosts.</p>
+        <p>Disabling ProxyPassInherit also disables <directive module="mod_proxy">BalancerInherit</directive>.</p>
+    </usage>
+</directivesynopsis>
+
+<directivesynopsis>
     <name>BalancerInherit</name>
-    <description>Inherit ProxyPassed Balancers/Workers from the main server</description>
+    <description>Inherit proxy Balancers/Workers defined from the main server</description>
     <syntax>BalancerInherit On|Off</syntax>
     <default>BalancerInherit On</default>
     <contextlist><context>server config</context><context>virtual
host</context></contextlist>
     <compatibility>BalancerInherit is only available in Apache HTTP Server 2.4.4 and
later.
         and later.</compatibility>
     <usage>
-        <p>This directive will cause the current server/vhost to "inherit" ProxyPass
+        <p>This directive will cause the current server/vhost to "inherit"
             Balancers and Workers defined in the main server. This can cause issues and
-            inconsistent behavior if using the Balancer Manager and so should be disabled
-            if using that feature.</p>
+            inconsistent behavior if using the Balancer Manager for dynamic changes
+            and so should be disabled if using that feature.</p>
         <p>The setting in the global server defines the default for all vhosts.</p>
+        <p>Disabling <directive module="mod_proxy">ProxyPassInherit</directive>
also disables BalancerInherit.</p>
     </usage>
 </directivesynopsis>
 

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1439404&r1=1439403&r2=1439404&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Mon Jan 28 13:58:24 2013
@@ -413,6 +413,7 @@
  * 20121222.1 (2.5.0-dev)  Add http_conformance to core_server_config,
  *                         add ap_has_cntrl()
  * 20121222.2 (2.5.0-dev)  Add ap_password_validate()
+ * 20121222.3 (2.5.0-dev)  Add ppinherit to proxy_server_conf
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
@@ -420,7 +421,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20121222
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 2                   /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 3                   /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1439404&r1=1439403&r2=1439404&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Mon Jan 28 13:58:24 2013
@@ -1162,6 +1162,8 @@ static void * create_proxy_config(apr_po
     ps->bal_persist = 0;
     ps->inherit = 1;
     ps->inherit_set = 0;
+    ps->ppinherit = 1;
+    ps->ppinherit_set = 0;
     ps->bgrowth = 5;
     ps->bgrowth_set = 0;
     ps->req_set = 0;
@@ -1191,12 +1193,20 @@ static void * merge_proxy_config(apr_poo
     ps->inherit = (overrides->inherit_set == 0) ? base->inherit : overrides->inherit;
     ps->inherit_set = overrides->inherit_set || base->inherit_set;
 
-    ps->proxies = apr_array_append(p, base->proxies, overrides->proxies);
+    ps->ppinherit = (overrides->ppinherit_set == 0) ? base->ppinherit : overrides->ppinherit;
+    ps->ppinherit_set = overrides->ppinherit_set || base->ppinherit_set;
+
+    if (ps->ppinherit) {
+        ps->proxies = apr_array_append(p, base->proxies, overrides->proxies);
+    }
+    else {
+        ps->proxies = overrides->proxies;
+    }
     ps->sec_proxy = apr_array_append(p, base->sec_proxy, overrides->sec_proxy);
     ps->aliases = apr_array_append(p, base->aliases, overrides->aliases);
     ps->noproxies = apr_array_append(p, base->noproxies, overrides->noproxies);
     ps->dirconn = apr_array_append(p, base->dirconn, overrides->dirconn);
-    if (ps->inherit) {
+    if (ps->inherit && ps->ppinherit) {
         ps->workers = apr_array_append(p, base->workers, overrides->workers);
         ps->balancers = apr_array_append(p, base->balancers, overrides->balancers);
     }
@@ -1911,6 +1921,16 @@ static const char *set_inherit(cmd_parms
     return NULL;
 }
 
+static const char *set_ppinherit(cmd_parms *parms, void *dummy, int flag)
+{
+    proxy_server_conf *psf =
+    ap_get_module_config(parms->server->module_config, &proxy_module);
+
+    psf->ppinherit = flag;
+    psf->ppinherit_set = 1;
+    return NULL;
+}
+
 static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg)
 {
     server_rec *s = cmd->server;
@@ -2301,8 +2321,11 @@ static const command_rec proxy_cmds[] =
     AP_INIT_FLAG("BalancerPersist", set_persist, NULL, RSRC_CONF,
      "on if the balancer should persist changes on reboot/restart made via the Balancer Manager"),
     AP_INIT_FLAG("BalancerInherit", set_inherit, NULL, RSRC_CONF,
-     "on if this server should inherit ProxyPassed balancers and workers defined in the main
server "
-     "(Not recommended if using the Balancer Manager)"),
+     "on if this server should inherit Balancers and Workers defined in the main server "
+     "(Not recommended if using the Balancer Manager for dynamic changes)"),
+    AP_INIT_FLAG("ProxyPassInherit", set_ppinherit, NULL, RSRC_CONF,
+     "on if this server should inherit all ProxyPass directives defined in the main server
"
+     "(Not recommended if using the Balancer Manager for dynamic changes)"),
     AP_INIT_TAKE1("ProxyStatus", set_status_opt, NULL, RSRC_CONF,
      "Configure Status: proxy status to one of: on | off | full"),
     AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1439404&r1=1439403&r2=1439404&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Mon Jan 28 13:58:24 2013
@@ -181,6 +181,8 @@ typedef struct {
     unsigned int inherit:1;
     unsigned int inherit_set:1;
     unsigned int bal_persist:1;
+    unsigned int ppinherit:1;
+    unsigned int ppinherit_set:1;
 } proxy_server_conf;
 
 



Mime
View raw message