jean-frederic clere wrote:
Ruediger Pluem wrote:
On 06/27/2007 05:09 PM, jean-frederic clere wrote:
Hi,
In mod_proxy_balancer.c there is the following code:
+++
/* Add the session route to request notes if present */
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);
}
+++
"session-route" is SC_A_JVM_ROUTE in AJP but what are the purpose of the
others?
Does
http://httpd.apache.org/docs/2.2/en/mod/mod_proxy_balancer.html#environment
answer this question?
So I have to propose the attached patch to get
http://svn.apache.org/viewvc?view=rev&rev=551935 and
http://svn.apache.org/viewvc?view=rev&rev=550519 correct.,
Oops the attachment was missing... Sorry.
Cheers
Jean-Frederic
Comments?
Cheers
Jean-Frederic
Regards
Rüdiger
Index: modules/proxy/mod_proxy_balancer.c
===================================================================
--- modules/proxy/mod_proxy_balancer.c (revision 552435)
+++ modules/proxy/mod_proxy_balancer.c (working copy)
@@ -241,6 +241,7 @@
static proxy_worker *find_session_route(proxy_balancer *balancer,
request_rec *r,
char **route,
+ const char **sticky_used,
char **url)
{
proxy_worker *worker = NULL;
@@ -253,13 +254,16 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: BALANCER: Found value %s for "
"stickysession %s", *route, balancer->sticky_path);
+ *sticky_used = balancer->sticky_path;
}
else {
*route = get_cookie_param(r, balancer->sticky);
- if (*route)
+ if (*route) {
+ *sticky_used = balancer->sticky;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: BALANCER: Found value %s for "
"stickysession %s", *route, balancer->sticky);
+ }
}
/*
* If we found a value for sticksession, find the first '.' within.
@@ -410,6 +414,7 @@
int access_status;
proxy_worker *runtime;
char *route = NULL;
+ const char *sticky = NULL;
apr_status_t rv;
*worker = NULL;
@@ -436,7 +441,7 @@
force_recovery(*balancer, r->server);
/* Step 4: find the session route */
- runtime = find_session_route(*balancer, r, &route, url);
+ runtime = find_session_route(*balancer, r, &route, &sticky, url);
if (runtime) {
int i, total_factor = 0;
proxy_worker *workers;
@@ -520,12 +525,12 @@
access_status = rewrite_url(r, *worker, url);
/* Add the session route to request notes if present */
if (route) {
- apr_table_setn(r->notes, "session-sticky", (*balancer)->sticky);
+ apr_table_setn(r->notes, "session-sticky", 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);
+ "BALANCER_SESSION_STICKY", sticky);
apr_table_setn(r->subprocess_env,
"BALANCER_SESSION_ROUTE", route);
}