summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2006-06-26 18:59:38 +0200
committerRuediger Pluem <rpluem@apache.org>2006-06-26 18:59:38 +0200
commit58f86ac058df0d413054cfef286a3824017737cf (patch)
tree333dcfba8dfb452c5b15901b462c4bde9a3d0632 /modules
parentPatch submitted by Matt Lewandowsky - fixes name of mod_isapi handler. (diff)
downloadapache2-58f86ac058df0d413054cfef286a3824017737cf.tar.xz
apache2-58f86ac058df0d413054cfef286a3824017737cf.zip
* Add the following environment variables to expose the information
* about the route, the sticky session and the worker used during a request to other modules: BALANCER_SESSION_STICKY BALANCER_SESSION_ROUTE BALANCER_NAME BALANCER_WORKER_NAME BALANCER_WORKER_ROUTE PR: 39806 Submitted by: Brian <brectanu gmail.com> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@417238 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/proxy/mod_proxy_balancer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c
index de1a15a476..e76dd1cfbc 100644
--- a/modules/proxy/mod_proxy_balancer.c
+++ b/modules/proxy/mod_proxy_balancer.c
@@ -389,6 +389,14 @@ static int proxy_balancer_pre_request(proxy_worker **worker,
*worker = runtime;
}
+ /* Add balancer/worker info to env. */
+ apr_table_setn(r->subprocess_env,
+ "BALANCER_NAME", (*balancer)->name);
+ apr_table_setn(r->subprocess_env,
+ "BALANCER_WORKER_NAME", (*worker)->name);
+ apr_table_setn(r->subprocess_env,
+ "BALANCER_WORKER_ROUTE", (*worker)->s->route);
+
/* Rewrite the url from 'balancer://url'
* to the 'worker_scheme://worker_hostname[:worker_port]/url'
* This replaces the balancers fictional name with the
@@ -399,6 +407,12 @@ static int proxy_balancer_pre_request(proxy_worker **worker,
if (route) {
apr_table_setn(r->notes, "session-sticky", (*balancer)->sticky);
apr_table_setn(r->notes, "session-route", route);
+
+ /* Add session info to env. */
+ apr_table_setn(r->subprocess_env,
+ "BALANCER_SESSION_STICKY", (*balancer)->sticky);
+ apr_table_setn(r->subprocess_env,
+ "BALANCER_SESSION_ROUTE", route);
}
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: BALANCER (%s) worker (%s) rewritten to %s",