Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 98103 invoked from network); 26 Jun 2006 17:00:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2006 17:00:01 -0000 Received: (qmail 67496 invoked by uid 500); 26 Jun 2006 17:00:01 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 67450 invoked by uid 500); 26 Jun 2006 17:00:00 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 67408 invoked by uid 99); 26 Jun 2006 17:00:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 10:00:00 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 10:00:00 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EF4CE1A983A; Mon, 26 Jun 2006 09:59:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r417238 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_proxy_balancer.xml modules/proxy/mod_proxy_balancer.c Date: Mon, 26 Jun 2006 16:59:39 -0000 To: cvs@httpd.apache.org From: rpluem@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060626165939.EF4CE1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: rpluem Date: Mon Jun 26 09:59:38 2006 New Revision: 417238 URL: http://svn.apache.org/viewvc?rev=417238&view=rev Log: * 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 Reviewed by: rpluem Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=417238&r1=417237&r2=417238&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Mon Jun 26 09:59:38 2006 @@ -2,6 +2,10 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) mod_proxy_balancer: Add information about the route, the sticky session + and the worker used during a request as environment variables. PR 39806. + [Brian ] + *) mod_isapi: Avoid double trailing slashes in HSE_REQ_MAP_URL_TO_PATH support. Also corrects the slashes for Windows. PR 15993 [William Rowe] Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml?rev=417238&r1=417237&r2=417238&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml Mon Jun 26 09:59:38 2006 @@ -271,6 +271,47 @@ +
+ Exported Environment Variables +

At present there are 5 environment variables exported:

+ + +
BALANCER_SESSION_STICKY
+
+

This is assigned the stickysession value used in the current + request. It is the cookie or parameter name used for sticky sessions

+
+ + +
BALANCER_SESSION_ROUTE
+
+

This is assigned the route parsed from the current + request.

+
+ + +
BALANCER_NAME
+
+

This is assigned the name of the balancer used for the current + request. The value is something like balancer://foo.

+
+ + +
BALANCER_WORKER_NAME
+
+

This is assigned the name of the worker used for the current request. + The value is something like http://hostA:1234.

+
+ + +
BALANCER_WORKER_ROUTE
+
+

This is assigned the route of the worker that will be + used for the current request.

+
+ +
+
Enabling Balancer Manager Support

This module requires the service of 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?rev=417238&r1=417237&r2=417238&view=diff ============================================================================== --- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original) +++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Mon Jun 26 09:59:38 2006 @@ -389,6 +389,14 @@ *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 @@ 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",