Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 55575 invoked from network); 9 Jul 2007 14:29:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2007 14:29:08 -0000 Received: (qmail 27485 invoked by uid 500); 9 Jul 2007 14:29:09 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 26973 invoked by uid 500); 9 Jul 2007 14:29:07 -0000 Mailing-List: contact dev-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 dev@httpd.apache.org Received: (qmail 26962 invoked by uid 99); 9 Jul 2007 14:29:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2007 07:29:07 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jfclere@gmail.com designates 209.85.132.250 as permitted sender) Received: from [209.85.132.250] (HELO an-out-0708.google.com) (209.85.132.250) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2007 07:29:03 -0700 Received: by an-out-0708.google.com with SMTP id b15so229816ana for ; Mon, 09 Jul 2007 07:28:43 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type; b=uO8SAaMrp3nVVNNxeOXSj9/NV3xb/Geaj4eO3zggg45YwTFQlyRmWl8bY4Co7kQO/ylkZDgky3iyYDUgSutKjRr0VUaceRr/ELmeCgCcJnm+VzpJ1stA0NmWo2oklrEdDCPq5opLLQ6IEVNXr9sk15cx9FpbmtRKXFwzzj3xIw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type; b=uddZ8fH+0sA4NjFAKCmMR5HgSiRe/rfFvw4hzeA2+ZtlYE3RDPxJ/4TmwxbZZoaP1KqFc6gV6j7QO0mYQTGgFucQPiqP4nYUMREFh5mOh75ZiWcm2vwEHBnSomkwhczoe9HFyRJD2BiTSYN0ry3BGwJCSiF4aIB1WNHTTQIO1Kg= Received: by 10.100.13.12 with SMTP id 12mr1598230anm.1183991323119; Mon, 09 Jul 2007 07:28:43 -0700 (PDT) Received: from ?192.168.4.143? ( [212.249.12.130]) by mx.google.com with ESMTP id g3sm5224905wra.2007.07.09.07.28.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Jul 2007 07:28:42 -0700 (PDT) Message-ID: <46924618.1090204@gmail.com> Date: Mon, 09 Jul 2007 16:28:40 +0200 From: jean-frederic clere User-Agent: Thunderbird 2.0.0.4 (X11/20070615) MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: apr_table_setn in mod_proxy_balancer.c References: <46827DB8.7080902@gmail.com> <468288BD.7020503@apache.org> <469245AF.6030804@gmail.com> In-Reply-To: <469245AF.6030804@gmail.com> Content-Type: multipart/mixed; boundary="------------040103070900090000060207" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------040103070900090000060207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 >> >> > > --------------040103070900090000060207 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" 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); } --------------040103070900090000060207--