From: Mladen Turk Date: Wed, 2 Aug 2006 06:54:01 +0000 (+0000) Subject: Enable ProxySet inside section to X-Git-Tag: 2.3.0~2186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20a4dc5137483d6e3905348e70c388aa5c1a1bf2;p=thirdparty%2Fapache%2Fhttpd.git 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@427920 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 10865704fbf..4edc797ee71 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -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); } }