Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 90266 invoked from network); 4 Feb 2011 16:11:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Feb 2011 16:11:42 -0000 Received: (qmail 16169 invoked by uid 500); 4 Feb 2011 16:11:41 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 15978 invoked by uid 500); 4 Feb 2011 16:11:39 -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 15971 invoked by uid 99); 4 Feb 2011 16:11:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Feb 2011 16:11:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Feb 2011 16:11:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 409A32388A41; Fri, 4 Feb 2011 16:11:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1067206 - /httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Date: Fri, 04 Feb 2011 16:11:16 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110204161116.409A32388A41@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Fri Feb 4 16:11:15 2011 New Revision: 1067206 URL: http://svn.apache.org/viewvc?rev=1067206&view=rev Log: might as well allow for the sticky session to be adjusted as well... 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?rev=1067206&r1=1067205&r2=1067206&view=diff ============================================================================== --- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original) +++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Fri Feb 4 16:11:15 2011 @@ -736,7 +736,7 @@ static int balancer_post_config(apr_pool ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Doing balancers create: %d, %d", (int)ALIGNED_PROXY_BALANCER_SHARED_SIZE, (int)conf->balancers->nelts); - + rv = storage->create(&new, conf->id, ALIGNED_PROXY_BALANCER_SHARED_SIZE, conf->balancers->nelts, AP_SLOTMEM_TYPE_PREGRAB, pconf); @@ -757,7 +757,7 @@ static int balancer_post_config(apr_pool balancer->max_workers = balancer->workers->nelts + balancer->growth; /* no need for the 'balancer://' prefix */ - ap_pstr2_alnum(pconf, balancer->name + sizeof(BALANCER_PREFIX) - 1, + ap_pstr2_alnum(pconf, balancer->name + sizeof(BALANCER_PREFIX) - 1, &balancer->sname); balancer->sname = apr_pstrcat(pconf, conf->id, "_", balancer->sname, NULL); @@ -778,7 +778,7 @@ static int balancer_post_config(apr_pool if ((rv = storage->grab(conf->slot, &index)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "balancer slotmem_grab failed"); return !OK; - + } if ((rv = storage->dptr(conf->slot, index, (void *)&bshm)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "balancer slotmem_dptr failed"); @@ -788,7 +788,7 @@ static int balancer_post_config(apr_pool ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "Cannot share balancer"); return !OK; } - + /* create slotmem slots for workers */ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Doing workers create: %s (%s), %d, %d", balancer->name, balancer->sname, @@ -989,6 +989,22 @@ static int balancer_handler(request_rec ival = atoi(val); bsel->s->sticky_force = (ival != 0); } + if ((val = apr_table_get(params, "b_ss")) && *val) { + if (strlen(val) < (PROXY_BALANCER_MAX_STICKY_SIZE-1)) { + if (*val == '-' && *(val+1) == '\0') + *bsel->s->sticky_path = *bsel->s->sticky = '\0'; + else { + char *path; + PROXY_STRNCPY(bsel->s->sticky_path, val); + PROXY_STRNCPY(bsel->s->sticky, val); + + if ((path = strchr((char *)bsel->s->sticky, '|'))) { + *path++ = '\0'; + PROXY_STRNCPY(bsel->s->sticky_path, path); + } + } + } + } } if (apr_table_get(params, "xml")) { @@ -1054,7 +1070,7 @@ static int balancer_handler(request_rec } } else { - ap_rputs(" - ", r); + ap_rputs(" (None) ", r); } ap_rprintf(r, "%s\n", balancer->s->sticky_force ? "On" : "Off"); @@ -1162,6 +1178,15 @@ static int balancer_handler(request_rec ap_rprintf(r, "value='%d'>\n", bsel->s->max_attempts); ap_rputs("Disable Failover:", r); create_radio("b_sforce", bsel->s->sticky_force, r); + ap_rputs("Sticky Session:s->sticky, bsel->s->sticky_path)) { + ap_rvputs(r, "value ='", bsel->s->sticky, " | ", + bsel->s->sticky_path, NULL); + } + else { + ap_rvputs(r, "value ='", bsel->s->sticky, NULL); + } + ap_rputs("'> (Use '-' to delete)\n", r); ap_rputs("\n", r); ap_rvputs(r, "\n