You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jf...@apache.org on 2007/07/10 11:53:38 UTC
svn commit: r554892 - /httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
Author: jfclere
Date: Tue Jul 10 02:53:36 2007
New Revision: 554892
URL: http://svn.apache.org/viewvc?view=rev&rev=554892
Log:
Fill notes "session-sticky" and subprocess_env "BALANCER_SESSION_STICKY"
correctly.
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?view=diff&rev=554892&r1=554891&r2=554892
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Tue Jul 10 02:53:36 2007
@@ -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);
}