From 11ba565b62b30e45757ae8a304025a2a6d52b96b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 31 Aug 2007 22:24:58 +0000 Subject: [PATCH] Merge r427920 from trunk: Enable ProxySet inside 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 | 9 --------- modules/proxy/mod_proxy.c | 27 +++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/STATUS b/STATUS index 20c3c7e6c21..17b01fd3e76 100644 --- 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 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 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); } } -- 2.47.3